diff mbox series

iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata()

Message ID 20230802120915.25631-1-aboutphysycs@gmail.com (mailing list archive)
State New, archived
Headers show
Series iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata() | expand

Commit Message

Andrei Coardos Aug. 2, 2023, 12:09 p.m. UTC
This function call was found to be unnecessary as there is no equivalent
platform_get_drvdata() call to access the private data of the driver. Also,
the private data is defined in this driver, so there is no risk of it being
accessed outside of this driver file.

Reviewed-by: Alexandru Ardelean <alex@shruggie.ro>
Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
---
 drivers/iio/trigger/stm32-lptimer-trigger.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Alexandru Ardelean Aug. 2, 2023, 12:37 p.m. UTC | #1
On Wed, Aug 2, 2023 at 3:09 PM Andrei Coardos <aboutphysycs@gmail.com> wrote:
>
> This function call was found to be unnecessary as there is no equivalent
> platform_get_drvdata() call to access the private data of the driver. Also,
> the private data is defined in this driver, so there is no risk of it being
> accessed outside of this driver file.
>
> Reviewed-by: Alexandru Ardelean <alex@shruggie.ro>
> Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
> ---
>  drivers/iio/trigger/stm32-lptimer-trigger.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/iio/trigger/stm32-lptimer-trigger.c b/drivers/iio/trigger/stm32-lptimer-trigger.c
> index 2e447a3f047d..df2416e33375 100644
> --- a/drivers/iio/trigger/stm32-lptimer-trigger.c
> +++ b/drivers/iio/trigger/stm32-lptimer-trigger.c
> @@ -92,8 +92,6 @@ static int stm32_lptim_trigger_probe(struct platform_device *pdev)
>         if (ret)
>                 return ret;

this can become now:

            return stm32_lptim_setup_trig(priv);


>
> -       platform_set_drvdata(pdev, priv);
> -
>         return 0;
>  }
>
> --
> 2.34.1
>
Jonathan Cameron Aug. 5, 2023, 6:04 p.m. UTC | #2
On Wed, 2 Aug 2023 15:37:02 +0300
Alexandru Ardelean <alex@shruggie.ro> wrote:

> On Wed, Aug 2, 2023 at 3:09 PM Andrei Coardos <aboutphysycs@gmail.com> wrote:
> >
> > This function call was found to be unnecessary as there is no equivalent
> > platform_get_drvdata() call to access the private data of the driver. Also,
> > the private data is defined in this driver, so there is no risk of it being
> > accessed outside of this driver file.
> >
> > Reviewed-by: Alexandru Ardelean <alex@shruggie.ro>
> > Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
> > ---
> >  drivers/iio/trigger/stm32-lptimer-trigger.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/iio/trigger/stm32-lptimer-trigger.c b/drivers/iio/trigger/stm32-lptimer-trigger.c
> > index 2e447a3f047d..df2416e33375 100644
> > --- a/drivers/iio/trigger/stm32-lptimer-trigger.c
> > +++ b/drivers/iio/trigger/stm32-lptimer-trigger.c
> > @@ -92,8 +92,6 @@ static int stm32_lptim_trigger_probe(struct platform_device *pdev)
> >         if (ret)
> >                 return ret;  
> 
> this can become now:
> 
>             return stm32_lptim_setup_trig(priv);
I made that change whilst applying.

Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to take a look at it and see if they can find anything
we missed.

Thanks,

Jonathan

> 
> 
> >
> > -       platform_set_drvdata(pdev, priv);
> > -
> >         return 0;
> >  }
> >
> > --
> > 2.34.1
> >
diff mbox series

Patch

diff --git a/drivers/iio/trigger/stm32-lptimer-trigger.c b/drivers/iio/trigger/stm32-lptimer-trigger.c
index 2e447a3f047d..df2416e33375 100644
--- a/drivers/iio/trigger/stm32-lptimer-trigger.c
+++ b/drivers/iio/trigger/stm32-lptimer-trigger.c
@@ -92,8 +92,6 @@  static int stm32_lptim_trigger_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	platform_set_drvdata(pdev, priv);
-
 	return 0;
 }