From: Andy Shevchenko Date: Fri, 26 Aug 2022 17:37:00 +0000 (+0300) Subject: hwmon: (iio_hwmon) Make use of device properties X-Git-Tag: v6.6.17~6502^2~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7b568c2525b3a59a49eaf81ad4f283f0c25b5b6;p=platform%2Fkernel%2Flinux-rpi.git hwmon: (iio_hwmon) Make use of device properties Convert the module to be property provider agnostic and allow it to be used on non-OF platforms. Include mod_devicetable.h explicitly to replace the dropped of.h which included mod_devicetable.h indirectly. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220826173700.17395-1-andriy.shevchenko@linux.intel.com Signed-off-by: Guenter Roeck --- diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c index 580a7d1..3aa4089 100644 --- a/drivers/hwmon/iio_hwmon.c +++ b/drivers/hwmon/iio_hwmon.c @@ -6,11 +6,13 @@ #include #include +#include #include #include #include +#include + #include -#include #include #include #include @@ -149,8 +151,8 @@ static int iio_hwmon_probe(struct platform_device *pdev) st->attr_group.attrs = st->attrs; st->groups[0] = &st->attr_group; - if (dev->of_node) { - sname = devm_kasprintf(dev, GFP_KERNEL, "%pOFn", dev->of_node); + if (dev_fwnode(dev)) { + sname = devm_kasprintf(dev, GFP_KERNEL, "%pfwP", dev_fwnode(dev)); if (!sname) return -ENOMEM; strreplace(sname, '-', '_');