Re: [PATCH] iio: st_sensors: fix trigger allocation

From: Andy Shevchenko

Date: Mon Mar 02 2026 - 03:15:22 EST


On Sat, Feb 28, 2026 at 06:11:02PM +0100, Aleksandrs Vinarskis wrote:
> Current hardcoded name prevents adding multiple st-sensors devices
> on the same platform. Fix by aligning trigger name with other drivers.

...

> - sdata->trig = devm_iio_trigger_alloc(parent, "%s-trigger",
> - indio_dev->name);
> + sdata->trig = devm_iio_trigger_alloc(parent, "%s-dev%d",
> + indio_dev->name,
> + iio_device_id(indio_dev));

I think you need to split this to more complex approach, id est:
- register the first one as with the current name
- use indexed variant for the rest

It will give something like %s-trigger, %s-trigger1 (if start from 0),
and so on. This way you won't break user space when it was defined for
a single trigger.

(Yes, I have read all emails in this thread as of time of replying to it.)

--
With Best Regards,
Andy Shevchenko