Skip to contentSkip to conversation

iio: trigger: stm32-lptimer-trigger: Make use of device properties

PATCH In review Andy Shevchenko 3 participants 5 messages Apr 13, 2022 – May 4, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: trigger: stm32-lptimer-trigger: Make use of device properties

Convert the module to be property provider agnostic and allow it to be used on non-OF platforms.

---
 drivers/iio/trigger/stm32-lptimer-trigger.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/trigger/stm32-lptimer-trigger.c +2 -1
index 98cdc7e47f3d..af46c10cea92 100644
@@ -13,6 +13,7 @@
 #include <linux/mfd/stm32-lptimer.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 
 /* List Low-Power Timer triggers */
 static const char * const stm32_lptim_triggers[] = {
@@ -77,7 +78,7 @@ static int stm32_lptim_trigger_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
-	if (of_property_read_u32(pdev->dev.of_node, "reg", &index))
+	if (device_property_read_u32(&pdev->dev, "reg", &index))
 		return -EINVAL;
 
 	if (index >= ARRAY_SIZE(stm32_lptim_triggers))
Signature · 1 line
2.35.1
maintainer
#1 lore raw
Quoted 4 lines · On Wed, 13 Apr 2022 21:56:56 +0300 Andy Shevchenko…

Convert the module to be property provider agnostic and allow it to be used on non-OF platforms.

MAINTAINERS entry for this one uses extensive wild cards so may escape scripts...

+CC Fabrice.

Quoted 25 lines
---
 drivers/iio/trigger/stm32-lptimer-trigger.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/trigger/stm32-lptimer-trigger.c +2 -1
index 98cdc7e47f3d..af46c10cea92 100644
@@ -13,6 +13,7 @@
 #include <linux/mfd/stm32-lptimer.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 
 /* List Low-Power Timer triggers */
 static const char * const stm32_lptim_triggers[] = {
@@ -77,7 +78,7 @@ static int stm32_lptim_trigger_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
-	if (of_property_read_u32(pdev->dev.of_node, "reg", &index))
+	if (device_property_read_u32(&pdev->dev, "reg", &index))
 		return -EINVAL;
 
 	if (index >= ARRAY_SIZE(stm32_lptim_triggers))
#2 lore raw
Quoted 6 lines · Jonathan Cameron
Quoted 3 lines · On Wed, 13 Apr 2022 21:56:56 +0300 Andy Shevchenko…

Convert the module to be property provider agnostic and allow it to be used on non-OF platforms.

Quoted 6 lines
Quoted 1 line

MAINTAINERS entry for this one uses extensive wild cards so may escape scripts...

+CC Fabrice.

Thanks!

Not sure it might break anything, it's quite straightforward conversion.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
Reviewed-by
#3 lore raw
Quoted 9 lines · Andy Shevchenko
Quoted 8 lines · Jonathan Cameron
Quoted 4 lines · On Wed, 13 Apr 2022 21:56:56 +0300 Andy Shevchenko…

Convert the module to be property provider agnostic and allow it to be used on non-OF platforms.

Quoted 8 lines
Quoted 4 lines

MAINTAINERS entry for this one uses extensive wild cards so may escape scripts...

+CC Fabrice.

Thanks!

Not sure it might break anything, it's quite straightforward conversion.

Hi Andy, Jonathan,

You can add my:

Thanks,
Best Regards,
Fabrice

Quoted 1 line
maintainer
#4 lore raw
Quoted 15 lines · On Tue, 3 May 2022 14:25:37 +0200 Fabrice Gasnier…
Quoted 14 lines · Andy Shevchenko
Quoted 12 lines · Jonathan Cameron
Quoted 4 lines · On Wed, 13 Apr 2022 21:56:56 +0300 Andy Shevchenko…

Convert the module to be property provider agnostic and allow it to be used on non-OF platforms.

MAINTAINERS entry for this one uses extensive wild cards so may escape scripts...

+CC Fabrice.

Quoted 8 lines
Quoted 3 lines

Thanks!

Not sure it might break anything, it's quite straightforward conversion.

Hi Andy, Jonathan,

You can add my:

Applied to the togreg branch of iio.git and pushed out as testing to let 0-day see if it can find anything we missed.

Thanks,

Jonathan

Quoted 6 lines

Thanks,
Best Regards,
Fabrice

Quoted 1 line