Skip to contentSkip to conversation

hwmon: Convert to using %pOF instead of full_name

PATCH Applied Rob Herring 2 participants 2 messages Jul 18, 2017 – Jul 19, 2017 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: Convert to using %pOF instead of full_name

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.

Cc Dirk Eibach <[email protected]>
Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
---
 drivers/hwmon/ads1015.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/hwmon/ads1015.c +6 -8
index 357b42607164..98c704d3366a 100644
@@ -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

maintainer Applied
#1 lore raw
Quoted 9 lines · Rob Herring

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.

Cc Dirk Eibach <[email protected]>
Cc Jean Delvare <jdelvare-IBi9RG/[email protected]>
Cc Guenter Roeck <[email protected]>

Applied to hwmon-next.

Thanks,
Guenter

Quoted 49 lines
---
  drivers/hwmon/ads1015.c | 14 ++++++--------
  1 file changed, 6 insertions(+), 8 deletions(-)
drivers/hwmon/ads1015.c +6 -9
index 357b42607164..98c704d3366a 100644
@@ -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;
  			}
  		}
--
Quoted 3 lines

2.11.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html