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

From: Andy Shevchenko
Date: Fri Sep 13 2024 - 13:54:20 EST


On Fri, Sep 13, 2024 at 10:55:40AM -0400, Parker Newman wrote:
> From: Parker Newman <pnewman@xxxxxxxxxxxxxxx>
>
> 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.
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).
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.

--
With Best Regards,
Andy Shevchenko