Message ID | 20210309193620.2176163-4-gwendal@chromium.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | iio: Set default trigger device parent | expand |
> -----Original Message----- > From: Gwendal Grignou <gwendal@chromium.org> > Sent: Tuesday, March 9, 2021 8:36 PM > To: jic23@kernel.org; lars@metafoo.de; > andy.shevchenko@gmail.com; ardeleanalex@gmail.com > Cc: linux-iio@vger.kernel.org; Gwendal Grignou > <gwendal@chromium.org> > Subject: [PATCH v4 3/8] iio: adis_trigger: Remove code to set trigger > parent > > > iio_trigger_set_drvdata() sets the trigger device parent to first > argument of viio_trigger_alloc(), no need to do it again in the driver > code. > Remove adis_trigger_setup() to match other drivers where setting the > trigger is usually done in the probe() routine. > > Signed-off-by: Gwendal Grignou <gwendal@chromium.org> > --- Reviewed-by: Nuno Sa <nuno.sa@analog.com>
diff --git a/drivers/iio/imu/adis_trigger.c b/drivers/iio/imu/adis_trigger.c index 64e0ba51cb18e..0f29e56200af3 100644 --- a/drivers/iio/imu/adis_trigger.c +++ b/drivers/iio/imu/adis_trigger.c @@ -27,13 +27,6 @@ static const struct iio_trigger_ops adis_trigger_ops = { .set_trigger_state = &adis_data_rdy_trigger_set_state, }; -static void adis_trigger_setup(struct adis *adis) -{ - adis->trig->dev.parent = &adis->spi->dev; - adis->trig->ops = &adis_trigger_ops; - iio_trigger_set_drvdata(adis->trig, adis); -} - static int adis_validate_irq_flag(struct adis *adis) { /* @@ -72,7 +65,8 @@ int devm_adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev) if (!adis->trig) return -ENOMEM; - adis_trigger_setup(adis); + adis->trig->ops = &adis_trigger_ops; + iio_trigger_set_drvdata(adis->trig, adis); ret = adis_validate_irq_flag(adis); if (ret)
iio_trigger_set_drvdata() sets the trigger device parent to first argument of viio_trigger_alloc(), no need to do it again in the driver code. Remove adis_trigger_setup() to match other drivers where setting the trigger is usually done in the probe() routine. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> --- Changes in v4: Improve commit message. No changes in v3. drivers/iio/imu/adis_trigger.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)