diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2021-07-02 15:56:01 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2021-07-05 00:22:51 +0200 |
commit | 3f5aa5ac0b0f9704f0c60f5fbbbcdc8c043d6eb6 (patch) | |
tree | 7a3998608200a560a9c410c9927c87d1dd097b93 /include/drm/drm_mipi_dbi.h | |
parent | fb786a48ac0dd63e702c05c35426f2e024f5749f (diff) | |
download | linux-stable-3f5aa5ac0b0f9704f0c60f5fbbbcdc8c043d6eb6.tar.gz linux-stable-3f5aa5ac0b0f9704f0c60f5fbbbcdc8c043d6eb6.tar.bz2 linux-stable-3f5aa5ac0b0f9704f0c60f5fbbbcdc8c043d6eb6.zip |
drm/dbi: Print errors for mipi_dbi_command()
The macro mipi_dbi_command() does not report errors unless you wrap it
in another macro to do the error reporting.
Report a rate-limited error so we know what is going on.
After this any code wishing to send command arrays can rely on
mipi_dbi_command() providing an appropriate error message if something
goes wrong.
Suggested-by: Noralf Trønnes <noralf@tronnes.org>
Suggested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210702135601.3952726-1-linus.walleij@linaro.org
Diffstat (limited to 'include/drm/drm_mipi_dbi.h')
-rw-r--r-- | include/drm/drm_mipi_dbi.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h index f543d6e3e822..05e194958265 100644 --- a/include/drm/drm_mipi_dbi.h +++ b/include/drm/drm_mipi_dbi.h @@ -183,7 +183,12 @@ int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb, #define mipi_dbi_command(dbi, cmd, seq...) \ ({ \ const u8 d[] = { seq }; \ - mipi_dbi_command_stackbuf(dbi, cmd, d, ARRAY_SIZE(d)); \ + struct device *dev = &(dbi)->spi->dev; \ + int ret; \ + ret = mipi_dbi_command_stackbuf(dbi, cmd, d, ARRAY_SIZE(d)); \ + if (ret) \ + dev_err_ratelimited(dev, "error %d when sending command %#02x\n", ret, cmd); \ + ret; \ }) #ifdef CONFIG_DEBUG_FS |