Commit bf5ff730 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Jonathan Cameron

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarFabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20220413185656.21994-1-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent f2906aa8
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/mfd/stm32-lptimer.h> #include <linux/mfd/stm32-lptimer.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/property.h>
/* List Low-Power Timer triggers */ /* List Low-Power Timer triggers */
static const char * const stm32_lptim_triggers[] = { static const char * const stm32_lptim_triggers[] = {
...@@ -77,7 +78,7 @@ static int stm32_lptim_trigger_probe(struct platform_device *pdev) ...@@ -77,7 +78,7 @@ static int stm32_lptim_trigger_probe(struct platform_device *pdev)
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
if (of_property_read_u32(pdev->dev.of_node, "reg", &index)) if (device_property_read_u32(&pdev->dev, "reg", &index))
return -EINVAL; return -EINVAL;
if (index >= ARRAY_SIZE(stm32_lptim_triggers)) if (index >= ARRAY_SIZE(stm32_lptim_triggers))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment