Skip to contentSkip to conversation

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

PATCH Superseded Andrei Coardos 3 participants 3 messages Aug 2, 2023 – Aug 5, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata()

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.

---
 drivers/iio/trigger/stm32-lptimer-trigger.c | 2 --
 1 file changed, 2 deletions(-)
drivers/iio/trigger/stm32-lptimer-trigger.c +0 -2
index 2e447a3f047d..df2416e33375 100644
@@ -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;
 }
 
Signature · 1 line
2.34.1
#1 lore raw
Quoted 17 lines · Andrei Coardos

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.

---
 drivers/iio/trigger/stm32-lptimer-trigger.c | 2 --
 1 file changed, 2 deletions(-)
drivers/iio/trigger/stm32-lptimer-trigger.c +0 -0
index 2e447a3f047d..df2416e33375 100644

drivers/iio/trigger/stm32-lptimer-trigger.c static int stm32_lptim_trigger_probe(struct platform_device *pdev) · line 93

Quoted 2 lines
drivers/iio/trigger/stm32-lptimer-trigger.c +0 -0
@@ -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);
Quoted 9 lines
drivers/iio/trigger/stm32-lptimer-trigger.c +0 -3
-       platform_set_drvdata(pdev, priv);
-
        return 0;
 }
 
--

2.34.1

maintainer
#2 lore raw
Quoted 23 lines · On Wed, 2 Aug 2023 15:37:02 +0300 Alexandru Ardelean <[email protected]> wrote:
Quoted 17 lines · Andrei Coardos

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.

---
 drivers/iio/trigger/stm32-lptimer-trigger.c | 2 --
 1 file changed, 2 deletions(-)
drivers/iio/trigger/stm32-lptimer-trigger.c +0 -0
index 2e447a3f047d..df2416e33375 100644

drivers/iio/trigger/stm32-lptimer-trigger.c static int stm32_lptim_trigger_probe(struct platform_device *pdev) · line 93

Quoted 2 lines
drivers/iio/trigger/stm32-lptimer-trigger.c +0 -0
@@ -92,8 +92,6 @@ static int stm32_lptim_trigger_probe(struct platform_device *pdev)
        if (ret)
                return ret;  

this can become now:

Quoted 1 line
            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

Quoted 11 lines
Quoted 11 lines
drivers/iio/trigger/stm32-lptimer-trigger.c +0 -3
-       platform_set_drvdata(pdev, priv);
-
        return 0;
 }
 
--

2.34.1