Re: [PATCH] iio: trigger: iio-trig-interrupt: use devm_* helpers
From: Andy Shevchenko
Date: Mon May 11 2026 - 09:50:06 EST
On Mon, May 11, 2026 at 03:33:06PM +0200, Joshua Crofts wrote:
> On Mon, 11 May 2026 at 15:23, Stepan Ionichev <sozdayvek@xxxxxxxxx> wrote:
...
> > No functional change.
>
> I would say that this is a functional change, you are changing
> how resources are managed and how teardown works. (But
> maybe I'm wrong).
Actually yes, this is quite a change that might have some subtle differences.
...
> > - trig = iio_trigger_alloc(NULL, "irqtrig%d", irq);
> > - if (!trig) {
> > - ret = -ENOMEM;
> > - goto error_ret;
> > - }
> > + trig = devm_iio_trigger_alloc(&pdev->dev, "irqtrig%d", irq);
Looking at this and taking into account the above, have you checked the
- trigger lifetime versus platform device
- parent-child relationship in the sysfs
The latter might lead to interesting side-effects.
> > + if (!trig)
> > + return -ENOMEM;
--
With Best Regards,
Andy Shevchenko