Re: [PATCH] spidev: Use dev_dbg() instead of pr_debug()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Fabio,

On Tue, Jun 4, 2019 at 4:53 AM Fabio Estevam <festevam@xxxxxxxxx> wrote:
> dev_dbg() is more appropriate for printing debug messages inside
> drivers, so switch to dev_dbg().
>
> Signed-off-by: Fabio Estevam <festevam@xxxxxxxxx>

Thanks for your patch!

> --- a/drivers/spi/spidev.c
> +++ b/drivers/spi/spidev.c
> @@ -560,7 +560,8 @@ static int spidev_open(struct inode *inode, struct file *filp)
>         }
>
>         if (status) {
> -               pr_debug("spidev: nothing for minor %d\n", iminor(inode));
> +               dev_dbg(&spidev->spi->dev, "spidev: nothing for minor %d\n",
> +                       iminor(inode));

This doesn't look correct to me, as a non-zero status indicates that the
corresponding spidev was not found, and thus spidev is not a valid
object pointer to dereference.

>                 goto err_find_dev;
>         }
>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux