iio: trigger: stm32-lptimer-trigger: remove unneeded platform_set_drvdata()
PATCH v2 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.
---
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(-)
drivers/iio/trigger/stm32-lptimer-trigger.c +1 -5
@@ -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[] = {
Signature · 1 line
2.34.1
Jonathan Cameron
maintainerQuoted 7 lines · On Wed, 2 Aug 2023 16:35:09 +0300 Andrei Coardos <[email protected]>…
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 <[email protected]>Signed-off-by Andrei Coardos <[email protected]>
Oops. Missed there was a v2. Ah well, end result the same ;)
Thanks,
Jonathan
Quoted 28 lines
---
Changelog
V1->V2:* https://lore.kernel.org/linux-iio/CAH3L5QpuoDYU6qvWH7_z5Yx0cW2qPMbCA8AFEYAPsiEkSzCiwQ@mail.gmail.com/T/#t
* Adjusted the returning values of the functiondrivers/iio/trigger/stm32-lptimer-trigger.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/iio/trigger/stm32-lptimer-trigger.c +1
-5@@ -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[] = {
Jonathan Cameron
maintainerQuoted 23 lines · On Wed, 2 Aug 2023 16:35:09 +0300 Andrei Coardos <[email protected]>…
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 <[email protected]>Signed-off-by Andrei Coardos <[email protected]>---
Changelog
V1->V2:* https://lore.kernel.org/linux-iio/CAH3L5QpuoDYU6qvWH7_z5Yx0cW2qPMbCA8AFEYAPsiEkSzCiwQ@mail.gmail.com/T/#t
* Adjusted the returning values of the functiondrivers/iio/trigger/stm32-lptimer-trigger.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/iio/trigger/stm32-lptimer-trigger.c +0
-0
drivers/iio/trigger/stm32-lptimer-trigger.c static int stm32_lptim_trigger_probe(struct platform_device *pdev) · line 91
Quoted 9 lines
drivers/iio/trigger/stm32-lptimer-trigger.c +1
-5@@ -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
Quoted 3 lines
drivers/iio/trigger/stm32-lptimer-trigger.c +0
-0}static const struct of_device_id stm32_lptim_trig_of_match[] = {
Thank you very much!
Quoted 45 lines · Jonathan Cameron
Quoted 23 lines · On Wed, 2 Aug 2023 16:35:09 +0300 Andrei Coardos <[email protected]>…
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 <[email protected]>Signed-off-by Andrei Coardos <[email protected]>---
Changelog
V1->V2:* https://lore.kernel.org/linux-iio/CAH3L5QpuoDYU6qvWH7_z5Yx0cW2qPMbCA8AFEYAPsiEkSzCiwQ@mail.gmail.com/T/#t
* Adjusted the returning values of the functiondrivers/iio/trigger/stm32-lptimer-trigger.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/iio/trigger/stm32-lptimer-trigger.c +0
-0drivers/iio/trigger/stm32-lptimer-trigger.c static int stm32_lptim_trigger_probe(struct platform_device *pdev) · line 91
Quoted 9 lines
drivers/iio/trigger/stm32-lptimer-trigger.c +1
-5@@ -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
Quoted 3 lines
drivers/iio/trigger/stm32-lptimer-trigger.c +0
-0}static const struct of_device_id stm32_lptim_trig_of_match[] = {