Re: [PATCH] iio: light: opt3001: split opt3001_get_processed() logic
From: Andy Shevchenko
Date: Wed Jul 08 2026 - 15:58:23 EST
On Wed, Jul 08, 2026 at 09:33:20PM +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.
> + timeout = (opt->int_time == OPT3001_INT_TIME_SHORT) ?
> + OPT3001_RESULT_READY_SHORT : OPT3001_RESULT_READY_LONG;
> + msleep(timeout);
It's not used after, so
if (opt->int_time == OPT3001_INT_TIME_SHORT)
msleep(OPT3001_RESULT_READY_SHORT);
else
msleep(OPT3001_RESULT_READY_LONG);
--
With Best Regards,
Andy Shevchenko