Commit 453a237c authored by Rob Herring's avatar Rob Herring Committed by Wolfram Sang

i2c: 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.
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 9242e72a
...@@ -98,8 +98,8 @@ static int of_i2c_gpio_get_pins(struct device_node *np, ...@@ -98,8 +98,8 @@ static int of_i2c_gpio_get_pins(struct device_node *np,
return -EPROBE_DEFER; return -EPROBE_DEFER;
if (!gpio_is_valid(*sda_pin) || !gpio_is_valid(*scl_pin)) { if (!gpio_is_valid(*sda_pin) || !gpio_is_valid(*scl_pin)) {
pr_err("%s: invalid GPIO pins, sda=%d/scl=%d\n", pr_err("%pOF: invalid GPIO pins, sda=%d/scl=%d\n",
np->full_name, *sda_pin, *scl_pin); np, *sda_pin, *scl_pin);
return -ENODEV; return -ENODEV;
} }
......
...@@ -234,7 +234,7 @@ static u32 i2c_powermac_get_addr(struct i2c_adapter *adap, ...@@ -234,7 +234,7 @@ static u32 i2c_powermac_get_addr(struct i2c_adapter *adap,
else if (!strcmp(node->name, "deq")) else if (!strcmp(node->name, "deq"))
return 0x34; return 0x34;
dev_warn(&adap->dev, "No i2c address for %s\n", node->full_name); dev_warn(&adap->dev, "No i2c address for %pOF\n", node);
return 0xffffffff; return 0xffffffff;
} }
...@@ -315,8 +315,7 @@ static bool i2c_powermac_get_type(struct i2c_adapter *adap, ...@@ -315,8 +315,7 @@ static bool i2c_powermac_get_type(struct i2c_adapter *adap,
} }
} }
dev_err(&adap->dev, "i2c-powermac: modalias failure" dev_err(&adap->dev, "i2c-powermac: modalias failure on %pOF\n", node);
" on %s\n", node->full_name);
return false; return false;
} }
...@@ -348,8 +347,7 @@ static void i2c_powermac_register_devices(struct i2c_adapter *adap, ...@@ -348,8 +347,7 @@ static void i2c_powermac_register_devices(struct i2c_adapter *adap,
if (!pmac_i2c_match_adapter(node, adap)) if (!pmac_i2c_match_adapter(node, adap))
continue; continue;
dev_dbg(&adap->dev, "i2c-powermac: register %s\n", dev_dbg(&adap->dev, "i2c-powermac: register %pOF\n", node);
node->full_name);
/* /*
* Keep track of some device existence to handle * Keep track of some device existence to handle
...@@ -372,7 +370,7 @@ static void i2c_powermac_register_devices(struct i2c_adapter *adap, ...@@ -372,7 +370,7 @@ static void i2c_powermac_register_devices(struct i2c_adapter *adap,
newdev = i2c_new_device(adap, &info); newdev = i2c_new_device(adap, &info);
if (!newdev) { if (!newdev) {
dev_err(&adap->dev, "i2c-powermac: Failure to register" dev_err(&adap->dev, "i2c-powermac: Failure to register"
" %s\n", node->full_name); " %pOF\n", node);
of_node_put(node); of_node_put(node);
/* We do not dispose of the interrupt mapping on /* We do not dispose of the interrupt mapping on
* purpose. It's not necessary (interrupt cannot be * purpose. It's not necessary (interrupt cannot be
......
...@@ -223,8 +223,8 @@ static int p2wi_probe(struct platform_device *pdev) ...@@ -223,8 +223,8 @@ static int p2wi_probe(struct platform_device *pdev)
if (childnp) { if (childnp) {
ret = of_property_read_u32(childnp, "reg", &slave_addr); ret = of_property_read_u32(childnp, "reg", &slave_addr);
if (ret) { if (ret) {
dev_err(dev, "invalid slave address on node %s\n", dev_err(dev, "invalid slave address on node %pOF\n",
childnp->full_name); childnp);
return -EINVAL; return -EINVAL;
} }
......
...@@ -32,18 +32,17 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap, ...@@ -32,18 +32,17 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
u32 addr; u32 addr;
int len; int len;
dev_dbg(&adap->dev, "of_i2c: register %s\n", node->full_name); dev_dbg(&adap->dev, "of_i2c: register %pOF\n", node);
if (of_modalias_node(node, info.type, sizeof(info.type)) < 0) { if (of_modalias_node(node, info.type, sizeof(info.type)) < 0) {
dev_err(&adap->dev, "of_i2c: modalias failure on %s\n", dev_err(&adap->dev, "of_i2c: modalias failure on %pOF\n",
node->full_name); node);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
addr_be = of_get_property(node, "reg", &len); addr_be = of_get_property(node, "reg", &len);
if (!addr_be || (len < sizeof(*addr_be))) { if (!addr_be || (len < sizeof(*addr_be))) {
dev_err(&adap->dev, "of_i2c: invalid reg on %s\n", dev_err(&adap->dev, "of_i2c: invalid reg on %pOF\n", node);
node->full_name);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
...@@ -59,8 +58,8 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap, ...@@ -59,8 +58,8 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
} }
if (i2c_check_addr_validity(addr, info.flags)) { if (i2c_check_addr_validity(addr, info.flags)) {
dev_err(&adap->dev, "of_i2c: invalid addr=%x on %s\n", dev_err(&adap->dev, "of_i2c: invalid addr=%x on %pOF\n",
addr, node->full_name); addr, node);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
...@@ -76,8 +75,7 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap, ...@@ -76,8 +75,7 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
result = i2c_new_device(adap, &info); result = i2c_new_device(adap, &info);
if (result == NULL) { if (result == NULL) {
dev_err(&adap->dev, "of_i2c: Failure registering %s\n", dev_err(&adap->dev, "of_i2c: Failure registering %pOF\n", node);
node->full_name);
of_node_put(node); of_node_put(node);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
...@@ -106,8 +104,8 @@ void of_i2c_register_devices(struct i2c_adapter *adap) ...@@ -106,8 +104,8 @@ void of_i2c_register_devices(struct i2c_adapter *adap)
client = of_i2c_register_device(adap, node); client = of_i2c_register_device(adap, node);
if (IS_ERR(client)) { if (IS_ERR(client)) {
dev_warn(&adap->dev, dev_warn(&adap->dev,
"Failed to create I2C device for %s\n", "Failed to create I2C device for %pOF\n",
node->full_name); node);
of_node_clear_flag(node, OF_POPULATED); of_node_clear_flag(node, OF_POPULATED);
} }
} }
...@@ -243,8 +241,8 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action, ...@@ -243,8 +241,8 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
put_device(&adap->dev); put_device(&adap->dev);
if (IS_ERR(client)) { if (IS_ERR(client)) {
dev_err(&adap->dev, "failed to create client for '%s'\n", dev_err(&adap->dev, "failed to create client for '%pOF'\n",
rd->dn->full_name); rd->dn);
of_node_clear_flag(rd->dn, OF_POPULATED); of_node_clear_flag(rd->dn, OF_POPULATED);
return notifier_from_errno(PTR_ERR(client)); return notifier_from_errno(PTR_ERR(client));
} }
......
...@@ -167,8 +167,8 @@ static ssize_t available_masters_show(struct device *dev, ...@@ -167,8 +167,8 @@ static ssize_t available_masters_show(struct device *dev,
int count = 0, i; int count = 0, i;
for (i = 0; i < priv->num_chan && count < PAGE_SIZE; i++) for (i = 0; i < priv->num_chan && count < PAGE_SIZE; i++)
count += scnprintf(buf + count, PAGE_SIZE - count, "%d:%s%c", count += scnprintf(buf + count, PAGE_SIZE - count, "%d:%pOF%c",
i, priv->chan[i].parent_np->full_name, i, priv->chan[i].parent_np,
i == priv->num_chan - 1 ? '\n' : ' '); i == priv->num_chan - 1 ? '\n' : ' ');
return count; return count;
......
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