Re: [PATCH v1 3/6] misc: eeprom: eeprom_93cx6: Replace printk(KERN_ERR ...) with pr_err()

Parker Newman
2024-09-13T19:12:39Z

On Fri, 13 Sep 2024 20:54:05 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> On Fri, Sep 13, 2024 at 10:55:40AM -0400, Parker Newman wrote:
> > From: Parker Newman <pnewman@connecttech.com>
> >
> > Replace printk(KERN_ERR ...) with pr_err() to improve readability.
> >
> > Fixes checkpatch warning:
> >
> > WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then
> > dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
> > + printk(KERN_ERR "%s: timeout\n", __func__);
>
> First of all, you probably want pr_fmt() to be defined.

Good point, I will add.

> Second, I would replace the entire while loop by the read_poll_timeout() macro
> from iopoll.h (note to use "true" for sleep before check and drop that one from
> before the loop in the driver).

Good idea.

> Naturally the pr_err() change can be combined with read_poll_timeout(), but
> if you go with pr_fmt() perhaps it still makes sense to have separate changes.
> I dunno which one is better, up to you.
>

Sorry if I am miss-reading but do you mean the pr_err() and pr_fmt() can be combined
and the read_poll_timeout() change should be made in a separate patch after?

Or should I be adding the pr_fmt() define in its own patch, followed by the pr_err()
and read_poll_timeout() in a patch?

Thanks,
Parker