linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata()
@ 2023-08-02 12:09 Andrei Coardos
  2023-08-02 12:37 ` Alexandru Ardelean
  0 siblings, 1 reply; 3+ messages in thread
From: Andrei Coardos @ 2023-08-02 12:09 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, linux-stm32, linux-iio
  Cc: alexandre.torgue, mcoquelin.stm32, lars, jic23, Andrei Coardos,
	Alexandru Ardelean

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;
 
-	platform_set_drvdata(pdev, priv);
-
 	return 0;
 }
 
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata()
  2023-08-02 12:09 [PATCH] iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata() Andrei Coardos
@ 2023-08-02 12:37 ` Alexandru Ardelean
  2023-08-05 18:04   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandru Ardelean @ 2023-08-02 12:37 UTC (permalink / raw)
  To: Andrei Coardos
  Cc: linux-kernel, linux-arm-kernel, linux-stm32, linux-iio,
	alexandre.torgue, mcoquelin.stm32, lars, jic23

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
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata()
  2023-08-02 12:37 ` Alexandru Ardelean
@ 2023-08-05 18:04   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2023-08-05 18:04 UTC (permalink / raw)
  To: Alexandru Ardelean
  Cc: Andrei Coardos, linux-kernel, linux-arm-kernel, linux-stm32,
	linux-iio, alexandre.torgue, mcoquelin.stm32, lars

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
> >  


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-05 18:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02 12:09 [PATCH] iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata() Andrei Coardos
2023-08-02 12:37 ` Alexandru Ardelean
2023-08-05 18:04   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).