* [PATCH v2 1/1] iio: trigger: stm32-timer: Make use of device properties
@ 2022-02-02 20:41 Andy Shevchenko
2022-02-05 17:31 ` Jonathan Cameron
0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2022-02-02 20:41 UTC (permalink / raw)
To: Andy Shevchenko, Jonathan Cameron, linux-iio, linux-kernel,
linux-stm32, linux-arm-kernel
Cc: Jonathan Cameron, Lars-Peter Clausen, Maxime Coquelin, Alexandre Torgue
Convert the module to be property provider agnostic and allow
it to be used on non-OF platforms.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: dropped depends on OF
drivers/iio/trigger/Kconfig | 2 +-
drivers/iio/trigger/stm32-timer-trigger.c | 11 ++++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/iio/trigger/Kconfig b/drivers/iio/trigger/Kconfig
index 8cef2f7452e8..7ecb69725b1d 100644
--- a/drivers/iio/trigger/Kconfig
+++ b/drivers/iio/trigger/Kconfig
@@ -38,7 +38,7 @@ config IIO_STM32_LPTIMER_TRIGGER
config IIO_STM32_TIMER_TRIGGER
tristate "STM32 Timer Trigger"
- depends on (ARCH_STM32 && OF && MFD_STM32_TIMERS) || COMPILE_TEST
+ depends on (ARCH_STM32 && MFD_STM32_TIMERS) || COMPILE_TEST
help
Select this option to enable STM32 Timer Trigger
diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c
index 4f9461e1412c..5049d9ecfc1a 100644
--- a/drivers/iio/trigger/stm32-timer-trigger.c
+++ b/drivers/iio/trigger/stm32-timer-trigger.c
@@ -11,9 +11,10 @@
#include <linux/iio/timer/stm32-timer-trigger.h>
#include <linux/iio/trigger.h>
#include <linux/mfd/stm32-timers.h>
+#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_device.h>
-#include <linux/of_device.h>
+#include <linux/property.h>
#define MAX_TRIGGERS 7
#define MAX_VALIDS 5
@@ -771,11 +772,11 @@ static int stm32_timer_trigger_probe(struct platform_device *pdev)
unsigned int index;
int ret;
- if (of_property_read_u32(dev->of_node, "reg", &index))
- return -EINVAL;
+ ret = device_property_read_u32(dev, "reg", &index);
+ if (ret)
+ return ret;
- cfg = (const struct stm32_timer_trigger_cfg *)
- of_match_device(dev->driver->of_match_table, dev)->data;
+ cfg = device_get_match_data(dev);
if (index >= ARRAY_SIZE(triggers_table) ||
index >= cfg->num_valids_table)
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/1] iio: trigger: stm32-timer: Make use of device properties
2022-02-02 20:41 [PATCH v2 1/1] iio: trigger: stm32-timer: Make use of device properties Andy Shevchenko
@ 2022-02-05 17:31 ` Jonathan Cameron
2022-02-09 14:24 ` Fabrice Gasnier
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2022-02-05 17:31 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Jonathan Cameron, linux-iio, linux-kernel, linux-stm32,
linux-arm-kernel, Lars-Peter Clausen, Maxime Coquelin,
Alexandre Torgue, Fabrice Gasnier
On Wed, 2 Feb 2022 22:41:12 +0200
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> Convert the module to be property provider agnostic and allow
> it to be used on non-OF platforms.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Looks fine to me. The stm32 drivers are well maintained so I'll
leave this one on list a little longer for feedback.
+Cc: Fabrice
> ---
> v2: dropped depends on OF
> drivers/iio/trigger/Kconfig | 2 +-
> drivers/iio/trigger/stm32-timer-trigger.c | 11 ++++++-----
> 2 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/trigger/Kconfig b/drivers/iio/trigger/Kconfig
> index 8cef2f7452e8..7ecb69725b1d 100644
> --- a/drivers/iio/trigger/Kconfig
> +++ b/drivers/iio/trigger/Kconfig
> @@ -38,7 +38,7 @@ config IIO_STM32_LPTIMER_TRIGGER
>
> config IIO_STM32_TIMER_TRIGGER
> tristate "STM32 Timer Trigger"
> - depends on (ARCH_STM32 && OF && MFD_STM32_TIMERS) || COMPILE_TEST
> + depends on (ARCH_STM32 && MFD_STM32_TIMERS) || COMPILE_TEST
> help
> Select this option to enable STM32 Timer Trigger
>
> diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c
> index 4f9461e1412c..5049d9ecfc1a 100644
> --- a/drivers/iio/trigger/stm32-timer-trigger.c
> +++ b/drivers/iio/trigger/stm32-timer-trigger.c
> @@ -11,9 +11,10 @@
> #include <linux/iio/timer/stm32-timer-trigger.h>
> #include <linux/iio/trigger.h>
> #include <linux/mfd/stm32-timers.h>
> +#include <linux/mod_devicetable.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> -#include <linux/of_device.h>
> +#include <linux/property.h>
>
> #define MAX_TRIGGERS 7
> #define MAX_VALIDS 5
> @@ -771,11 +772,11 @@ static int stm32_timer_trigger_probe(struct platform_device *pdev)
> unsigned int index;
> int ret;
>
> - if (of_property_read_u32(dev->of_node, "reg", &index))
> - return -EINVAL;
> + ret = device_property_read_u32(dev, "reg", &index);
> + if (ret)
> + return ret;
>
> - cfg = (const struct stm32_timer_trigger_cfg *)
> - of_match_device(dev->driver->of_match_table, dev)->data;
> + cfg = device_get_match_data(dev);
>
> if (index >= ARRAY_SIZE(triggers_table) ||
> index >= cfg->num_valids_table)
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/1] iio: trigger: stm32-timer: Make use of device properties
2022-02-05 17:31 ` Jonathan Cameron
@ 2022-02-09 14:24 ` Fabrice Gasnier
2022-02-13 18:22 ` Jonathan Cameron
0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Gasnier @ 2022-02-09 14:24 UTC (permalink / raw)
To: Jonathan Cameron, Andy Shevchenko
Cc: Jonathan Cameron, linux-iio, linux-kernel, linux-stm32,
linux-arm-kernel, Lars-Peter Clausen, Maxime Coquelin,
Alexandre Torgue, Olivier MOYSAN
On 2/5/22 6:31 PM, Jonathan Cameron wrote:
> On Wed, 2 Feb 2022 22:41:12 +0200
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>
>> Convert the module to be property provider agnostic and allow
>> it to be used on non-OF platforms.
>>
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Looks fine to me. The stm32 drivers are well maintained so I'll
> leave this one on list a little longer for feedback.
>
> +Cc: Fabrice
>
>> ---
>> v2: dropped depends on OF
>> drivers/iio/trigger/Kconfig | 2 +-
>> drivers/iio/trigger/stm32-timer-trigger.c | 11 ++++++-----
>> 2 files changed, 7 insertions(+), 6 deletions(-)
Hi Andy, Jonathan,
You can add my:
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Thanks,
Best Regards,
Fabrice
>>
>> diff --git a/drivers/iio/trigger/Kconfig b/drivers/iio/trigger/Kconfig
>> index 8cef2f7452e8..7ecb69725b1d 100644
>> --- a/drivers/iio/trigger/Kconfig
>> +++ b/drivers/iio/trigger/Kconfig
>> @@ -38,7 +38,7 @@ config IIO_STM32_LPTIMER_TRIGGER
>>
>> config IIO_STM32_TIMER_TRIGGER
>> tristate "STM32 Timer Trigger"
>> - depends on (ARCH_STM32 && OF && MFD_STM32_TIMERS) || COMPILE_TEST
>> + depends on (ARCH_STM32 && MFD_STM32_TIMERS) || COMPILE_TEST
>> help
>> Select this option to enable STM32 Timer Trigger
>>
>> diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c
>> index 4f9461e1412c..5049d9ecfc1a 100644
>> --- a/drivers/iio/trigger/stm32-timer-trigger.c
>> +++ b/drivers/iio/trigger/stm32-timer-trigger.c
>> @@ -11,9 +11,10 @@
>> #include <linux/iio/timer/stm32-timer-trigger.h>
>> #include <linux/iio/trigger.h>
>> #include <linux/mfd/stm32-timers.h>
>> +#include <linux/mod_devicetable.h>
>> #include <linux/module.h>
>> #include <linux/platform_device.h>
>> -#include <linux/of_device.h>
>> +#include <linux/property.h>
>>
>> #define MAX_TRIGGERS 7
>> #define MAX_VALIDS 5
>> @@ -771,11 +772,11 @@ static int stm32_timer_trigger_probe(struct platform_device *pdev)
>> unsigned int index;
>> int ret;
>>
>> - if (of_property_read_u32(dev->of_node, "reg", &index))
>> - return -EINVAL;
>> + ret = device_property_read_u32(dev, "reg", &index);
>> + if (ret)
>> + return ret;
>>
>> - cfg = (const struct stm32_timer_trigger_cfg *)
>> - of_match_device(dev->driver->of_match_table, dev)->data;
>> + cfg = device_get_match_data(dev);
>>
>> if (index >= ARRAY_SIZE(triggers_table) ||
>> index >= cfg->num_valids_table)
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/1] iio: trigger: stm32-timer: Make use of device properties
2022-02-09 14:24 ` Fabrice Gasnier
@ 2022-02-13 18:22 ` Jonathan Cameron
0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2022-02-13 18:22 UTC (permalink / raw)
To: Fabrice Gasnier
Cc: Andy Shevchenko, Jonathan Cameron, linux-iio, linux-kernel,
linux-stm32, linux-arm-kernel, Lars-Peter Clausen,
Maxime Coquelin, Alexandre Torgue, Olivier MOYSAN
On Wed, 9 Feb 2022 15:24:22 +0100
Fabrice Gasnier <fabrice.gasnier@foss.st.com> wrote:
> On 2/5/22 6:31 PM, Jonathan Cameron wrote:
> > On Wed, 2 Feb 2022 22:41:12 +0200
> > Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
> >
> >> Convert the module to be property provider agnostic and allow
> >> it to be used on non-OF platforms.
> >>
> >> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Looks fine to me. The stm32 drivers are well maintained so I'll
> > leave this one on list a little longer for feedback.
> >
> > +Cc: Fabrice
> >
> >> ---
> >> v2: dropped depends on OF
> >> drivers/iio/trigger/Kconfig | 2 +-
> >> drivers/iio/trigger/stm32-timer-trigger.c | 11 ++++++-----
> >> 2 files changed, 7 insertions(+), 6 deletions(-)
>
> Hi Andy, Jonathan,
>
> You can add my:
> Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Applied to the togreg branch of iio.git and pushed out as testing for
0-day to poke at it and see if we missed anything.
Thanks,
Jonathan
>
> Thanks,
> Best Regards,
> Fabrice
>
> >>
> >> diff --git a/drivers/iio/trigger/Kconfig b/drivers/iio/trigger/Kconfig
> >> index 8cef2f7452e8..7ecb69725b1d 100644
> >> --- a/drivers/iio/trigger/Kconfig
> >> +++ b/drivers/iio/trigger/Kconfig
> >> @@ -38,7 +38,7 @@ config IIO_STM32_LPTIMER_TRIGGER
> >>
> >> config IIO_STM32_TIMER_TRIGGER
> >> tristate "STM32 Timer Trigger"
> >> - depends on (ARCH_STM32 && OF && MFD_STM32_TIMERS) || COMPILE_TEST
> >> + depends on (ARCH_STM32 && MFD_STM32_TIMERS) || COMPILE_TEST
> >> help
> >> Select this option to enable STM32 Timer Trigger
> >>
> >> diff --git a/drivers/iio/trigger/stm32-timer-trigger.c b/drivers/iio/trigger/stm32-timer-trigger.c
> >> index 4f9461e1412c..5049d9ecfc1a 100644
> >> --- a/drivers/iio/trigger/stm32-timer-trigger.c
> >> +++ b/drivers/iio/trigger/stm32-timer-trigger.c
> >> @@ -11,9 +11,10 @@
> >> #include <linux/iio/timer/stm32-timer-trigger.h>
> >> #include <linux/iio/trigger.h>
> >> #include <linux/mfd/stm32-timers.h>
> >> +#include <linux/mod_devicetable.h>
> >> #include <linux/module.h>
> >> #include <linux/platform_device.h>
> >> -#include <linux/of_device.h>
> >> +#include <linux/property.h>
> >>
> >> #define MAX_TRIGGERS 7
> >> #define MAX_VALIDS 5
> >> @@ -771,11 +772,11 @@ static int stm32_timer_trigger_probe(struct platform_device *pdev)
> >> unsigned int index;
> >> int ret;
> >>
> >> - if (of_property_read_u32(dev->of_node, "reg", &index))
> >> - return -EINVAL;
> >> + ret = device_property_read_u32(dev, "reg", &index);
> >> + if (ret)
> >> + return ret;
> >>
> >> - cfg = (const struct stm32_timer_trigger_cfg *)
> >> - of_match_device(dev->driver->of_match_table, dev)->data;
> >> + cfg = device_get_match_data(dev);
> >>
> >> if (index >= ARRAY_SIZE(triggers_table) ||
> >> index >= cfg->num_valids_table)
> >
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-02-13 18:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 20:41 [PATCH v2 1/1] iio: trigger: stm32-timer: Make use of device properties Andy Shevchenko
2022-02-05 17:31 ` Jonathan Cameron
2022-02-09 14:24 ` Fabrice Gasnier
2022-02-13 18:22 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).