Re: [PATCH v3 3/4] iio: accel: adxl372: factor out buffer and trigger setup
From: Andy Shevchenko
Date: Fri Mar 13 2026 - 10:17:32 EST
On Fri, Mar 13, 2026 at 01:54:56PM +0200, Antoniu Miclaus wrote:
> Extract the triggered buffer, trigger allocation, and IRQ request
> logic from adxl372_probe() into a dedicated adxl372_buffer_setup()
> helper. This reduces the probe function complexity and prepares for
> conditionally disabling buffer support on device variants with
> known FIFO issues.
>
> No functional change intended.
...
> + ret = devm_iio_trigger_register(dev, st->dready_trig);
> + if (ret < 0)
Consider dropping ' < 0' parts where they are not required.
> + return ret;
> +
> + ret = devm_iio_trigger_register(dev, st->peak_datardy_trig);
> + if (ret < 0)
> + return ret;
> +
> + indio_dev->trig = iio_trigger_get(st->dready_trig);
> + return devm_request_irq(dev, st->irq,
> + iio_trigger_generic_data_rdy_poll,
> + IRQF_TRIGGER_RISING | IRQF_NO_THREAD,
> + indio_dev->name, st->dready_trig);
This left for the context as the last one doesn't have such a check.
--
With Best Regards,
Andy Shevchenko