diff mbox series

thermal: sun8i_thermal: remove unneeded call to platform_set_drvdata()

Message ID 20230811194032.4240-1-aboutphysycs@gmail.com (mailing list archive)
State New, archived
Headers show
Series thermal: sun8i_thermal: remove unneeded call to platform_set_drvdata() | expand

Commit Message

Andrei Coardos Aug. 11, 2023, 7:40 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.

Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
---
 drivers/thermal/sun8i_thermal.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Jernej Škrabec Aug. 13, 2023, 3:32 p.m. UTC | #1
Dne petek, 11. avgust 2023 ob 21:40:32 CEST je Andrei Coardos napisal(a):
> 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.
> 
> Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>

Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> ---
>  drivers/thermal/sun8i_thermal.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/thermal/sun8i_thermal.c
> b/drivers/thermal/sun8i_thermal.c index 195f3c5d0b38..61a2f287ac90 100644
> --- a/drivers/thermal/sun8i_thermal.c
> +++ b/drivers/thermal/sun8i_thermal.c
> @@ -489,8 +489,6 @@ static int sun8i_ths_probe(struct platform_device *pdev)
> if (!tmdev->chip)
>  		return -EINVAL;
> 
> -	platform_set_drvdata(pdev, tmdev);
> -
>  	ret = sun8i_ths_resource_init(tmdev);
>  	if (ret)
>  		return ret;
Alexandru Ardelean Aug. 13, 2023, 6:58 p.m. UTC | #2
On Sun, Aug 13, 2023 at 6:32 PM Jernej Škrabec <jernej.skrabec@gmail.com> wrote:
>
> Dne petek, 11. avgust 2023 ob 21:40:32 CEST je Andrei Coardos napisal(a):
> > 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.
> >
> > Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
>

Reviewed-by: Alexandru Ardelean <alex@shruggie.ro>

> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
>
> Best regards,
> Jernej
>
> > ---
> >  drivers/thermal/sun8i_thermal.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/thermal/sun8i_thermal.c
> > b/drivers/thermal/sun8i_thermal.c index 195f3c5d0b38..61a2f287ac90 100644
> > --- a/drivers/thermal/sun8i_thermal.c
> > +++ b/drivers/thermal/sun8i_thermal.c
> > @@ -489,8 +489,6 @@ static int sun8i_ths_probe(struct platform_device *pdev)
> > if (!tmdev->chip)
> >               return -EINVAL;
> >
> > -     platform_set_drvdata(pdev, tmdev);
> > -
> >       ret = sun8i_ths_resource_init(tmdev);
> >       if (ret)
> >               return ret;
>
>
>
>
Daniel Lezcano Aug. 16, 2023, 10:32 a.m. UTC | #3
On 11/08/2023 21:40, Andrei Coardos 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.
> 
> Signed-off-by: Andrei Coardos <aboutphysycs@gmail.com>
> ---

Applied, thanks

Are you checking neither dev_get_drvdata is used ?
diff mbox series

Patch

diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c
index 195f3c5d0b38..61a2f287ac90 100644
--- a/drivers/thermal/sun8i_thermal.c
+++ b/drivers/thermal/sun8i_thermal.c
@@ -489,8 +489,6 @@  static int sun8i_ths_probe(struct platform_device *pdev)
 	if (!tmdev->chip)
 		return -EINVAL;
 
-	platform_set_drvdata(pdev, tmdev);
-
 	ret = sun8i_ths_resource_init(tmdev);
 	if (ret)
 		return ret;