* [PATCH] hwmon: Convert to using %pOF instead of full_name
@ 2017-07-18 21:43 Rob Herring
[not found] ` <20170718214339.7774-25-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2017-07-18 21:43 UTC (permalink / raw)
To: Guenter Roeck
Cc: linux-kernel, devicetree, Dirk Eibach, Jean Delvare, linux-hwmon
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.
Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Dirk Eibach <eibach@gdsys.de>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
---
drivers/hwmon/ads1015.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/hwmon/ads1015.c b/drivers/hwmon/ads1015.c
index 357b42607164..98c704d3366a 100644
--- a/drivers/hwmon/ads1015.c
+++ b/drivers/hwmon/ads1015.c
@@ -191,24 +191,23 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
unsigned int data_rate = ADS1015_DEFAULT_DATA_RATE;
if (of_property_read_u32(node, "reg", &pval)) {
- dev_err(&client->dev, "invalid reg on %s\n",
- node->full_name);
+ dev_err(&client->dev, "invalid reg on %pOF\n", node);
continue;
}
channel = pval;
if (channel >= ADS1015_CHANNELS) {
dev_err(&client->dev,
- "invalid channel index %d on %s\n",
- channel, node->full_name);
+ "invalid channel index %d on %pOF\n",
+ channel, node);
continue;
}
if (!of_property_read_u32(node, "ti,gain", &pval)) {
pga = pval;
if (pga > 6) {
- dev_err(&client->dev, "invalid gain on %s\n",
- node->full_name);
+ dev_err(&client->dev, "invalid gain on %pOF\n",
+ node);
return -EINVAL;
}
}
@@ -217,8 +216,7 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
data_rate = pval;
if (data_rate > 7) {
dev_err(&client->dev,
- "invalid data_rate on %s\n",
- node->full_name);
+ "invalid data_rate on %pOF\n", node);
return -EINVAL;
}
}
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hwmon: Convert to using %pOF instead of full_name
[not found] ` <20170718214339.7774-25-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
@ 2017-07-19 1:47 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2017-07-19 1:47 UTC (permalink / raw)
To: Rob Herring
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, Dirk Eibach, Jean Delvare,
linux-hwmon-u79uwXL29TY76Z2rM5mHXA
On 07/18/2017 02:43 PM, Rob Herring wrote:
> Now that we have a custom printf format specifier, convert users of
> full_name to use %pOF instead. This is preparation to remove storing
> of the full path string for each node.
>
> Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Cc: Dirk Eibach <eibach-dJ+jgKLZIg4@public.gmane.org>
> Cc: Jean Delvare <jdelvare-IBi9RG/b67k@public.gmane.org>
> Cc: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
> Cc: linux-hwmon-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Applied to hwmon-next.
Thanks,
Guenter
> ---
> drivers/hwmon/ads1015.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/hwmon/ads1015.c b/drivers/hwmon/ads1015.c
> index 357b42607164..98c704d3366a 100644
> --- a/drivers/hwmon/ads1015.c
> +++ b/drivers/hwmon/ads1015.c
> @@ -191,24 +191,23 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
> unsigned int data_rate = ADS1015_DEFAULT_DATA_RATE;
>
> if (of_property_read_u32(node, "reg", &pval)) {
> - dev_err(&client->dev, "invalid reg on %s\n",
> - node->full_name);
> + dev_err(&client->dev, "invalid reg on %pOF\n", node);
> continue;
> }
>
> channel = pval;
> if (channel >= ADS1015_CHANNELS) {
> dev_err(&client->dev,
> - "invalid channel index %d on %s\n",
> - channel, node->full_name);
> + "invalid channel index %d on %pOF\n",
> + channel, node);
> continue;
> }
>
> if (!of_property_read_u32(node, "ti,gain", &pval)) {
> pga = pval;
> if (pga > 6) {
> - dev_err(&client->dev, "invalid gain on %s\n",
> - node->full_name);
> + dev_err(&client->dev, "invalid gain on %pOF\n",
> + node);
> return -EINVAL;
> }
> }
> @@ -217,8 +216,7 @@ static int ads1015_get_channels_config_of(struct i2c_client *client)
> data_rate = pval;
> if (data_rate > 7) {
> dev_err(&client->dev,
> - "invalid data_rate on %s\n",
> - node->full_name);
> + "invalid data_rate on %pOF\n", node);
> return -EINVAL;
> }
> }
> --
> 2.11.0
>
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-07-19 1:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-18 21:43 [PATCH] hwmon: Convert to using %pOF instead of full_name Rob Herring
[not found] ` <20170718214339.7774-25-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-07-19 1:47 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).