Message ID | 20201210204211.967018-4-gwendal@chromium.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | iio: Set default trigger device parent | expand |
On Thu, Dec 10, 2020 at 10:42 PM Gwendal Grignou <gwendal@chromium.org> wrote: > > Already done in boiler plate code. Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com> > > Signed-off-by: Gwendal Grignou <gwendal@chromium.org> > --- > drivers/iio/imu/adis_trigger.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/iio/imu/adis_trigger.c b/drivers/iio/imu/adis_trigger.c > index 64e0ba51cb18..0f29e56200af 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) > -- > 2.29.2.576.ga3fc446d84-goog >
diff --git a/drivers/iio/imu/adis_trigger.c b/drivers/iio/imu/adis_trigger.c index 64e0ba51cb18..0f29e56200af 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)
Already done in boiler plate code. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> --- drivers/iio/imu/adis_trigger.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)