diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2021-03-09 20:36:13 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2021-03-25 20:13:50 +0100 |
commit | 995071d36bb9804b644265450142fcb91c427ee8 (patch) | |
tree | ebe33a3eebf243584b57f7e584b874e6815112d8 /drivers/iio/gyro/itg3200_buffer.c | |
parent | iio: adc: ad7124: allow more than 8 channels (diff) | |
download | linux-995071d36bb9804b644265450142fcb91c427ee8.tar.xz linux-995071d36bb9804b644265450142fcb91c427ee8.zip |
iio: set default trig->dev.parent
When allocated with [devm_]iio_trigger_alloc(), set trig device parent to
the device the trigger is allocated for by default.
It can always be reassigned in the probe routine.
Change iio_trigger_alloc() API to add the device pointer to be coherent
with devm_iio_trigger_alloc, using similar interface to
iio_device_alloc().
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210309193620.2176163-2-gwendal@chromium.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/gyro/itg3200_buffer.c')
-rw-r--r-- | drivers/iio/gyro/itg3200_buffer.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/iio/gyro/itg3200_buffer.c b/drivers/iio/gyro/itg3200_buffer.c index 1c3c1bd53374..af0aaa146f0c 100644 --- a/drivers/iio/gyro/itg3200_buffer.c +++ b/drivers/iio/gyro/itg3200_buffer.c @@ -113,7 +113,7 @@ int itg3200_probe_trigger(struct iio_dev *indio_dev) int ret; struct itg3200 *st = iio_priv(indio_dev); - st->trig = iio_trigger_alloc("%s-dev%d", indio_dev->name, + st->trig = iio_trigger_alloc(&st->i2c->dev, "%s-dev%d", indio_dev->name, indio_dev->id); if (!st->trig) return -ENOMEM; @@ -127,7 +127,6 @@ int itg3200_probe_trigger(struct iio_dev *indio_dev) goto error_free_trig; - st->trig->dev.parent = &st->i2c->dev; st->trig->ops = &itg3200_trigger_ops; iio_trigger_set_drvdata(st->trig, indio_dev); ret = iio_trigger_register(st->trig); |