On Mon, Sep 12, 2022 at 07:34:38AM -0600, Simon Glass wrote:
> On Mon, 12 Sept 2022 at 06:15, Takumi Sueda <puhit...@gmail.com> wrote:
> >
> > It introduces the way to rotate the screen for boards with rotated screen.
> >
> > Signed-off-by: Takumi Sueda <puhit...@gmail.com>
> > ---
> >  drivers/video/simplefb.c | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/video/simplefb.c b/drivers/video/simplefb.c
> > index 2b0d8835e3..dbf55ba64d 100644
> > --- a/drivers/video/simplefb.c
> > +++ b/drivers/video/simplefb.c
> > @@ -43,7 +43,11 @@ static int simple_video_probe(struct udevice *dev)
> >
> >         uc_priv->xsize = fdtdec_get_uint(blob, node, "width", 0);
> >         uc_priv->ysize = fdtdec_get_uint(blob, node, "height", 0);
> > -       uc_priv->rot = 0;
> > +       uc_priv->rot = fdtdec_get_uint(blob, node, "rot", 0);
> > +       if (uc_priv->rot > 3) {
> > +               printf("%s: invalid rot\n", __func__);
> 
> log_debug()
> 
> This is a driver so should not print messages
> 
> > +               return -EINVAL;
> 
> You can use
> 
>    return log_msg_ret("rot", -EINVAL)
> 
> if you like, since then it could be logged when
> CONFIG_LOG_ERROR_RETURN is enabled.
> 
> > +       }
> >
> >         format = fdt_getprop(blob, node, "format", NULL);
> >         debug("%s: %dx%d@%s\n", __func__, uc_priv->xsize, uc_priv->ysize, 
> > format);
> > --
> > 2.20.1
> >
> 
> Regards,
> Simon

Hi Simon, thanks for the review.

The printf() was copied from the next error return, but the method you
proposed me sounds better for debugging since printf() is uncontrollable.

I'll send a v2 patch later.

Thanks again,
Takumi

Reply via email to