]> Git Repo - linux.git/commitdiff
iio: trigger: stm32-timer: Make use of device properties
authorAndy Shevchenko <[email protected]>
Wed, 2 Feb 2022 20:41:12 +0000 (22:41 +0200)
committerJonathan Cameron <[email protected]>
Fri, 18 Feb 2022 11:35:49 +0000 (11:35 +0000)
Convert the module to be property provider agnostic and allow
it to be used on non-OF platforms.

Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Fabrice Gasnier <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jonathan Cameron <[email protected]>
drivers/iio/trigger/Kconfig
drivers/iio/trigger/stm32-timer-trigger.c

index 8cef2f7452e85eb974df7fad3fe3c34d55e9169e..7ecb69725b1dab67920c6c99515f6639ace9bd46 100644 (file)
@@ -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
 
index 4f9461e1412cb02b955cf0abbea7730ab834d3c3..5049d9ecfc1a93517f09529c45c4695560af849b 100644 (file)
 #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)
This page took 0.072732 seconds and 4 git commands to generate.