Re: [PATCH v4 4/5] iio: adc: versal-sysmon: add threshold event support
From: Erim, Salih
Date: Wed Jun 10 2026 - 07:47:33 EST
Hi Andy,
On 09/06/2026 18:31, Andy Shevchenko wrote:
On Sun, Jun 07, 2026 at 10:02:47PM +0100, Erim, Salih wrote:
On 07/06/2026 08:31, Andy Shevchenko wrote:
On Sat, Jun 06, 2026 at 06:17:06AM +0100, Salih Erim wrote:
...
+ ret = regmap_read(sysmon->regmap, upper_off, &upper_reg);
+ if (ret)
+ return ret;
+
+ ret = regmap_read(sysmon->regmap, lower_off, &lower_reg);
+ if (ret)
+ return ret;
Half of the IO accessors have no error checks, these do.
Why is this inconsistency?
The regmap calls in sysmon_unmask_worker and sysmon_iio_irq
have no error checks because they run in contexts where errors
cannot be propagated (workqueue, hardirq). The init path checks
errors because it can return them to the caller. Will add a
comment explaining this.
But the error checks may be used to modify flow inside the respective functions.
Accepted. Will add error checks in sysmon_unmask_worker and
sysmon_iio_irq to bail out early on regmap failure instead of
operating on undefined data.
Thanks,
Salih
--
With Best Regards,
Andy Shevchenko