[PATCH] drm/dbi: Print errors for mipi_dbi_command()

Linus Walleij linus.walleij at linaro.org
Fri Jul 2 09:58:52 UTC 2021


On Fri, Jul 2, 2021 at 7:45 AM Sam Ravnborg <sam at ravnborg.org> wrote:

> > -     ret = mipi_dbi_command(dbi, MIPI_DCS_SOFT_RESET);
> > +     ret = mipi_dbi_command_buf(dbi, MIPI_DCS_SOFT_RESET, NULL, 0);
> >       if (ret) {
> >               DRM_DEV_ERROR(dev, "Failed to send reset command (%d)\n", ret);
> >               if (dbidev->regulator)
>
> I do not see the value in this change??
> There are many other mipi_dbi_command() users and the error return
> continues to be checked?!??!

When we change the mipi_dbi_command() macro to check the error
value we can no longer retrieve the return value from the macro
so we need to use the call the command buf directly so that we
can obtain the return code.

I do not know any other way. Suggestions welcome!

> >  #define mipi_dbi_command(dbi, cmd, seq...) \
> >  ({ \
> >       const u8 d[] = { seq }; \
> > -     mipi_dbi_command_stackbuf(dbi, cmd, d, ARRAY_SIZE(d)); \
> > +     int ret; \
> > +     ret = mipi_dbi_command_stackbuf(dbi, cmd, d, ARRAY_SIZE(d)); \
> > +     if (ret) \
> > +             pr_err_ratelimited("MIPI DBI: error %d when sending command\n", ret); \
> >  })
>
> Coud this be more informative if the spi device was printed, it is
> available? Maybe in 99% of the cases there is only one user anyway so it
> will not help?

Hm I can get to the SPI device, lemme try this.

Yours,
Linus Walleij


More information about the dri-devel mailing list