diff mbox series

[v2,3/7] iio: adis_trigger: Remove code to set trigger parent

Message ID 20201210204211.967018-4-gwendal@chromium.org (mailing list archive)
State New, archived
Headers show
Series iio: Set default trigger device parent | expand

Commit Message

Gwendal Grignou Dec. 10, 2020, 8:42 p.m. UTC
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(-)

Comments

Alexandru Ardelean Dec. 11, 2020, 7:48 a.m. UTC | #1
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 mbox series

Patch

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)