* [PATCH v2] iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata()
@ 2023-08-02 13:35 Andrei Coardos
2023-08-05 18:05 ` Jonathan Cameron
2023-08-05 18:30 ` Jonathan Cameron
0 siblings, 2 replies; 4+ messages in thread
From: Andrei Coardos @ 2023-08-02 13:35 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>
---
Changelog V1->V2:
* https://lore.kernel.org/linux-iio/CAH3L5QpuoDYU6qvWH7_z5Yx0cW2qPMbCA8AFEYAPsiEkSzCiwQ@mail.gmail.com/T/#t
* Adjusted the returning values of the function
drivers/iio/trigger/stm32-lptimer-trigger.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/iio/trigger/stm32-lptimer-trigger.c b/drivers/iio/trigger/stm32-lptimer-trigger.c
index df2416e33375..ab1cc6a05f26 100644
--- a/drivers/iio/trigger/stm32-lptimer-trigger.c
+++ b/drivers/iio/trigger/stm32-lptimer-trigger.c
@@ -88,11 +88,7 @@ static int stm32_lptim_trigger_probe(struct platform_device *pdev)
priv->dev = &pdev->dev;
priv->trg = stm32_lptim_triggers[index];
- ret = stm32_lptim_setup_trig(priv);
- if (ret)
- return ret;
-
- return 0;
+ return stm32_lptim_setup_trig(priv);
}
static const struct of_device_id stm32_lptim_trig_of_match[] = {
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata()
2023-08-02 13:35 [PATCH v2] iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata() Andrei Coardos
@ 2023-08-05 18:05 ` Jonathan Cameron
2023-08-05 18:30 ` Jonathan Cameron
1 sibling, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2023-08-05 18:05 UTC (permalink / raw)
To: Andrei Coardos
Cc: linux-kernel, linux-arm-kernel, linux-stm32, linux-iio,
alexandre.torgue, mcoquelin.stm32, lars, Alexandru Ardelean
On Wed, 2 Aug 2023 16:35:09 +0300
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>
Oops. Missed there was a v2. Ah well, end result the same ;)
Thanks,
Jonathan
> ---
>
> Changelog V1->V2:
>
> * https://lore.kernel.org/linux-iio/CAH3L5QpuoDYU6qvWH7_z5Yx0cW2qPMbCA8AFEYAPsiEkSzCiwQ@mail.gmail.com/T/#t
> * Adjusted the returning values of the function
>
>
> drivers/iio/trigger/stm32-lptimer-trigger.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/iio/trigger/stm32-lptimer-trigger.c b/drivers/iio/trigger/stm32-lptimer-trigger.c
> index df2416e33375..ab1cc6a05f26 100644
> --- a/drivers/iio/trigger/stm32-lptimer-trigger.c
> +++ b/drivers/iio/trigger/stm32-lptimer-trigger.c
> @@ -88,11 +88,7 @@ static int stm32_lptim_trigger_probe(struct platform_device *pdev)
> priv->dev = &pdev->dev;
> priv->trg = stm32_lptim_triggers[index];
>
> - ret = stm32_lptim_setup_trig(priv);
> - if (ret)
> - return ret;
> -
> - return 0;
> + return stm32_lptim_setup_trig(priv);
> }
>
> static const struct of_device_id stm32_lptim_trig_of_match[] = {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata()
2023-08-02 13:35 [PATCH v2] iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata() Andrei Coardos
2023-08-05 18:05 ` Jonathan Cameron
@ 2023-08-05 18:30 ` Jonathan Cameron
2023-08-06 8:14 ` Andrei Coardos
1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2023-08-05 18:30 UTC (permalink / raw)
To: Andrei Coardos
Cc: linux-kernel, linux-arm-kernel, linux-stm32, linux-iio,
alexandre.torgue, mcoquelin.stm32, lars, Alexandru Ardelean
On Wed, 2 Aug 2023 16:35:09 +0300
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>
> ---
>
> Changelog V1->V2:
>
> * https://lore.kernel.org/linux-iio/CAH3L5QpuoDYU6qvWH7_z5Yx0cW2qPMbCA8AFEYAPsiEkSzCiwQ@mail.gmail.com/T/#t
> * Adjusted the returning values of the function
>
>
> drivers/iio/trigger/stm32-lptimer-trigger.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/iio/trigger/stm32-lptimer-trigger.c b/drivers/iio/trigger/stm32-lptimer-trigger.c
> index df2416e33375..ab1cc6a05f26 100644
> --- a/drivers/iio/trigger/stm32-lptimer-trigger.c
> +++ b/drivers/iio/trigger/stm32-lptimer-trigger.c
> @@ -88,11 +88,7 @@ static int stm32_lptim_trigger_probe(struct platform_device *pdev)
> priv->dev = &pdev->dev;
> priv->trg = stm32_lptim_triggers[index];
>
> - ret = stm32_lptim_setup_trig(priv);
> - if (ret)
> - return ret;
> -
> - return 0;
> + return stm32_lptim_setup_trig(priv);
Both of us failed to notice ret isn't used any more. Anyhow, I cleaned that
up after spotting the build warning.
Jonathan
> }
>
> static const struct of_device_id stm32_lptim_trig_of_match[] = {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata()
2023-08-05 18:30 ` Jonathan Cameron
@ 2023-08-06 8:14 ` Andrei Coardos
0 siblings, 0 replies; 4+ messages in thread
From: Andrei Coardos @ 2023-08-06 8:14 UTC (permalink / raw)
To: Jonathan Cameron
Cc: linux-kernel, linux-arm-kernel, linux-stm32, linux-iio,
alexandre.torgue, mcoquelin.stm32, lars, Alexandru Ardelean
Thank you very much!
On Sat, 5 Aug 2023 at 21:31, Jonathan Cameron <jic23@kernel.org> wrote:
>
> On Wed, 2 Aug 2023 16:35:09 +0300
> 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>
> > ---
> >
> > Changelog V1->V2:
> >
> > * https://lore.kernel.org/linux-iio/CAH3L5QpuoDYU6qvWH7_z5Yx0cW2qPMbCA8AFEYAPsiEkSzCiwQ@mail.gmail.com/T/#t
> > * Adjusted the returning values of the function
> >
> >
> > drivers/iio/trigger/stm32-lptimer-trigger.c | 6 +-----
> > 1 file changed, 1 insertion(+), 5 deletions(-)
> >
> > diff --git a/drivers/iio/trigger/stm32-lptimer-trigger.c b/drivers/iio/trigger/stm32-lptimer-trigger.c
> > index df2416e33375..ab1cc6a05f26 100644
> > --- a/drivers/iio/trigger/stm32-lptimer-trigger.c
> > +++ b/drivers/iio/trigger/stm32-lptimer-trigger.c
> > @@ -88,11 +88,7 @@ static int stm32_lptim_trigger_probe(struct platform_device *pdev)
> > priv->dev = &pdev->dev;
> > priv->trg = stm32_lptim_triggers[index];
> >
> > - ret = stm32_lptim_setup_trig(priv);
> > - if (ret)
> > - return ret;
> > -
> > - return 0;
> > + return stm32_lptim_setup_trig(priv);
> Both of us failed to notice ret isn't used any more. Anyhow, I cleaned that
> up after spotting the build warning.
>
> Jonathan
>
> > }
> >
> > static const struct of_device_id stm32_lptim_trig_of_match[] = {
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-08-06 8:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02 13:35 [PATCH v2] iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata() Andrei Coardos
2023-08-05 18:05 ` Jonathan Cameron
2023-08-05 18:30 ` Jonathan Cameron
2023-08-06 8:14 ` Andrei Coardos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox