[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220818232256.GA3505808@roeck-us.net>
Date: Thu, 18 Aug 2022 16:22:56 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
Jean Delvare <jdelvare@...e.com>
Subject: Re: [PATCH v1 1/1] hwmon: (iio_hwmon) Make use of device properties
On Sat, Jul 30, 2022 at 03:50:24PM +0300, Andy Shevchenko wrote:
> Convert the module to be property provider agnostic and allow
> it to be used on non-OF platforms.
>
> Add mod_devicetable.h include.
>
What does that have to do with this patch ?
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> drivers/hwmon/iio_hwmon.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c
> index 580a7d125b88..3aa40893fc09 100644
> --- a/drivers/hwmon/iio_hwmon.c
> +++ b/drivers/hwmon/iio_hwmon.c
> @@ -6,11 +6,13 @@
>
> #include <linux/kernel.h>
> #include <linux/slab.h>
> +#include <linux/mod_devicetable.h>
> #include <linux/module.h>
> #include <linux/err.h>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
> +
> #include <linux/hwmon.h>
> -#include <linux/of.h>
> #include <linux/hwmon-sysfs.h>
> #include <linux/iio/consumer.h>
> #include <linux/iio/types.h>
> @@ -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, '-', '_');
Powered by blists - more mailing lists