[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=UZqzWd+Ke2sU-z86jnhKhUo8v0ChyKYnGpmx+s7n0stQ@mail.gmail.com>
Date: Fri, 25 Jul 2025 14:16:26 -0700
From: Doug Anderson <dianders@...omium.org>
To: Brigham Campbell <me@...ghamcampbell.com>
Cc: maarten.lankhorst@...ux.intel.com, mripard@...nel.org, tzimmermann@...e.de,
airlied@...il.com, simona@...ll.ch, linus.walleij@...aro.org,
neil.armstrong@...aro.org, jessica.zhang@....qualcomm.com, sam@...nborg.org,
skhan@...uxfoundation.org, linux-kernel-mentees@...ts.linux.dev,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] drm: Create mipi_dsi_dcs_read_multi()
Hi,
On Thu, Jul 24, 2025 at 1:23 PM Brigham Campbell <me@...ghamcampbell.com> wrote:
>
> +void mipi_dsi_dcs_read_multi(struct mipi_dsi_multi_context *ctx, u8 cmd,
> + void *data, size_t len)
> +{
> + struct mipi_dsi_device *dsi = ctx->dsi;
> + struct device *dev = &dsi->dev;
> + struct mipi_dsi_msg msg = {
> + .channel = dsi->channel,
> + .type = MIPI_DSI_DCS_READ,
> + .tx_buf = &cmd,
> + .tx_len = 1,
> + .rx_buf = data,
> + .rx_len = len
> + };
> + ssize_t ret;
> +
> + if (ctx->accum_err)
> + return;
> +
> + ret = mipi_dsi_device_transfer(dsi, &msg);
> + if (ret < 0) {
> + ctx->accum_err = ret;
> + dev_err(dev, "transferring dcs message %xh failed: %d\n", cmd,
Format code "%xh" is probably not exactly what you want. If the error
code is 0x10 it will print 10h, which is not very standard. You
probably copied it from the write routine which uses "%*ph". There the
"h" means something. See Documentation/core-api/printk-formats.rst.
Probably you want "%#x".
I'd probably also say "dcs read with cmd" rather than "transferring
dcs message".
Powered by blists - more mailing lists