[PATCH 26/35] iio: light: vl6180: use default_trigger
From: Jonathan Cameron
Date: Sun Nov 15 2026 - 20:51:08 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. In this particular case the ordering does
not result in a leak so the intent is to make that less fragile
going forwards.
Signed-off-by: Jonathan Cameron <jonathan.cameron@xxxxxxxxxxxxxxxx>
---
drivers/iio/light/vl6180.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/light/vl6180.c b/drivers/iio/light/vl6180.c
index 44fd0446b583..249d383b5292 100644
--- a/drivers/iio/light/vl6180.c
+++ b/drivers/iio/light/vl6180.c
@@ -736,7 +736,7 @@ static int vl6180_probe(struct i2c_client *client)
if (ret)
return ret;
- indio_dev->trig = iio_trigger_get(data->trig);
+ indio_dev->default_trigger = data->trig;
}
return devm_iio_device_register(&client->dev, indio_dev);
--
2.56.1