From bf5ff730dcc2540d39ed572f551f79524c4d7eb8 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Wed, 13 Apr 2022 21:56:56 +0300 Subject: 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. Signed-off-by: Andy Shevchenko Reviewed-by: Fabrice Gasnier Link: https://lore.kernel.org/r/20220413185656.21994-1-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron --- drivers/iio/trigger/stm32-lptimer-trigger.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/iio/trigger') diff --git a/drivers/iio/trigger/stm32-lptimer-trigger.c b/drivers/iio/trigger/stm32-lptimer-trigger.c index 98cdc7e47f3d..af46c10cea92 100644 --- a/drivers/iio/trigger/stm32-lptimer-trigger.c +++ b/drivers/iio/trigger/stm32-lptimer-trigger.c @@ -13,6 +13,7 @@ #include #include #include +#include /* 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)) -- cgit v1.2.3 From f93d3a779272a319f767a85a9062ebf69ecf5311 Mon Sep 17 00:00:00 2001 From: Nuno Sá Date: Fri, 10 Jun 2022 10:45:29 +0200 Subject: iio: trigger: stm32-lptimer-trigger: explicitly add proper header files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do not trust the fact that iio.h includes of.h which in turn includes all the headers we are relying on. The ultimate goal is to actually drop of.h from iio.h. Signed-off-by: Nuno Sá Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220610084545.547700-19-nuno.sa@analog.com Signed-off-by: Jonathan Cameron --- drivers/iio/trigger/stm32-lptimer-trigger.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/iio/trigger') diff --git a/drivers/iio/trigger/stm32-lptimer-trigger.c b/drivers/iio/trigger/stm32-lptimer-trigger.c index af46c10cea92..2e447a3f047d 100644 --- a/drivers/iio/trigger/stm32-lptimer-trigger.c +++ b/drivers/iio/trigger/stm32-lptimer-trigger.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include -- cgit v1.2.3