Re: [PATCH v4] iio: light: opt3001: split opt3001_get_processed() logic
From: Andy Shevchenko
Date: Tue Jul 14 2026 - 13:05:26 EST
On Tue, Jul 14, 2026 at 05:36:48PM +0200, Joshua Crofts wrote:
> Split the logic inside the opt3001_get_processed() function, as the
> current flow is hard to read, mixing IRQ and non-IRQ code blocks.
>
> Separate the IRQ code path into its own function, same for the
> non-IRQ path.
LGTM, FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
...
> ret = i2c_smbus_write_word_swapped(client, OPT3001_CONFIGURATION, reg);
> - if (ret < 0) {
> + if (ret < 0)
At some point consider dropping ' < 0' pieces for the i2c_smbus_write_*() cases.
Read cases are different, of course.
> dev_err(dev, "failed to write register %02x\n",
> OPT3001_CONFIGURATION);
> +
> + return ret;
--
With Best Regards,
Andy Shevchenko