[PATCH 16/35] iio: light: acpi-als: use default_trigger
From: Jonathan Cameron
Date: Sun Nov 15 2026 - 20:51:30 EST
From: Jonathan Cameron <jonathan.cameron@xxxxxxxxxxxxxxxx>
Set indio_dev->default_trigger rather than taking a reference to the
trigger in probe(). The IIO core now takes the reference during
iio_device_register(), so it is not leaked if probe() fails after
the trigger is set up. This also makes the ordering a lot less fragile
going forwards.
Fixes: 24b84444eb6f ("iio: acpi_als: Add trigger support")
Signed-off-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxxxxxxxx>
---
drivers/iio/light/acpi-als.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/light/acpi-als.c b/drivers/iio/light/acpi-als.c
index 9faaffb94b8f..b4434fdb561f 100644
--- a/drivers/iio/light/acpi-als.c
+++ b/drivers/iio/light/acpi-als.c
@@ -214,7 +214,7 @@ static int acpi_als_probe(struct platform_device *pdev)
* Set hardware trigger by default to let events flow when
* BIOS support notification.
*/
- indio_dev->trig = iio_trigger_get(als->trig);
+ indio_dev->default_trigger = als->trig;
ret = devm_iio_triggered_buffer_setup(dev, indio_dev,
iio_pollfunc_store_time,
--
2.56.1