Re: [PATCH v2] counter: 104-quad-8: Fix incorrect return value in IRQ handler

From: Andy Shevchenko

Date: Fri Dec 12 2025 - 10:04:45 EST


On Fri, Dec 12, 2025 at 12:34:07PM +0900, William Breathitt Gray wrote:
> On Sun, Dec 07, 2025 at 02:00:07AM +0800, Haotian Zhang wrote:

...

> > ret = regmap_read(priv->map, QUAD8_INTERRUPT_STATUS, &status);
> > - if (ret)
> > - return ret;
> > + if (ret) {
> > + WARN_ONCE(true, "quad8: regmap_read failed: %d\n", ret);
>
> The warning should indicate the purpose of the operation so users know
> what failed for the hardware. So perhaps "quad8: Attempt to read
> Interrupt Status Register failed: %d\n" is better.
>
> > ret = regmap_write(priv->map, QUAD8_CHANNEL_OPERATION, CLEAR_PENDING_INTERRUPTS);
> > - if (ret)
> > - return ret;
> > + if (ret) {
> > + WARN_ONCE(true, "quad8: regmap_write failed: %d\n", ret);
>
> For the same reason as above, perhaps "quad8: Attempt to clear pending
> interrupts by writing to Channel Operation Register failed: %d\n" is
> better.

On top of that, I'm wondering if we can use dev_WARN_ONCE() and drop "quad8: "
prefix.

--
With Best Regards,
Andy Shevchenko