Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Rob Herring <robh@kernel.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

authored by

Rob Herring and committed by
Wolfram Sang
453a237c 9242e72a

+21 -25
+2 -2
drivers/i2c/busses/i2c-gpio.c
··· 98 98 return -EPROBE_DEFER; 99 99 100 100 if (!gpio_is_valid(*sda_pin) || !gpio_is_valid(*scl_pin)) { 101 - pr_err("%s: invalid GPIO pins, sda=%d/scl=%d\n", 102 - np->full_name, *sda_pin, *scl_pin); 101 + pr_err("%pOF: invalid GPIO pins, sda=%d/scl=%d\n", 102 + np, *sda_pin, *scl_pin); 103 103 return -ENODEV; 104 104 } 105 105
+4 -6
drivers/i2c/busses/i2c-powermac.c
··· 234 234 else if (!strcmp(node->name, "deq")) 235 235 return 0x34; 236 236 237 - dev_warn(&adap->dev, "No i2c address for %s\n", node->full_name); 237 + dev_warn(&adap->dev, "No i2c address for %pOF\n", node); 238 238 239 239 return 0xffffffff; 240 240 } ··· 315 315 } 316 316 } 317 317 318 - dev_err(&adap->dev, "i2c-powermac: modalias failure" 319 - " on %s\n", node->full_name); 318 + dev_err(&adap->dev, "i2c-powermac: modalias failure on %pOF\n", node); 320 319 return false; 321 320 } 322 321 ··· 347 348 if (!pmac_i2c_match_adapter(node, adap)) 348 349 continue; 349 350 350 - dev_dbg(&adap->dev, "i2c-powermac: register %s\n", 351 - node->full_name); 351 + dev_dbg(&adap->dev, "i2c-powermac: register %pOF\n", node); 352 352 353 353 /* 354 354 * Keep track of some device existence to handle ··· 370 372 newdev = i2c_new_device(adap, &info); 371 373 if (!newdev) { 372 374 dev_err(&adap->dev, "i2c-powermac: Failure to register" 373 - " %s\n", node->full_name); 375 + " %pOF\n", node); 374 376 of_node_put(node); 375 377 /* We do not dispose of the interrupt mapping on 376 378 * purpose. It's not necessary (interrupt cannot be
+2 -2
drivers/i2c/busses/i2c-sun6i-p2wi.c
··· 223 223 if (childnp) { 224 224 ret = of_property_read_u32(childnp, "reg", &slave_addr); 225 225 if (ret) { 226 - dev_err(dev, "invalid slave address on node %s\n", 227 - childnp->full_name); 226 + dev_err(dev, "invalid slave address on node %pOF\n", 227 + childnp); 228 228 return -EINVAL; 229 229 } 230 230
+11 -13
drivers/i2c/i2c-core-of.c
··· 32 32 u32 addr; 33 33 int len; 34 34 35 - dev_dbg(&adap->dev, "of_i2c: register %s\n", node->full_name); 35 + dev_dbg(&adap->dev, "of_i2c: register %pOF\n", node); 36 36 37 37 if (of_modalias_node(node, info.type, sizeof(info.type)) < 0) { 38 - dev_err(&adap->dev, "of_i2c: modalias failure on %s\n", 39 - node->full_name); 38 + dev_err(&adap->dev, "of_i2c: modalias failure on %pOF\n", 39 + node); 40 40 return ERR_PTR(-EINVAL); 41 41 } 42 42 43 43 addr_be = of_get_property(node, "reg", &len); 44 44 if (!addr_be || (len < sizeof(*addr_be))) { 45 - dev_err(&adap->dev, "of_i2c: invalid reg on %s\n", 46 - node->full_name); 45 + dev_err(&adap->dev, "of_i2c: invalid reg on %pOF\n", node); 47 46 return ERR_PTR(-EINVAL); 48 47 } 49 48 ··· 58 59 } 59 60 60 61 if (i2c_check_addr_validity(addr, info.flags)) { 61 - dev_err(&adap->dev, "of_i2c: invalid addr=%x on %s\n", 62 - addr, node->full_name); 62 + dev_err(&adap->dev, "of_i2c: invalid addr=%x on %pOF\n", 63 + addr, node); 63 64 return ERR_PTR(-EINVAL); 64 65 } 65 66 ··· 75 76 76 77 result = i2c_new_device(adap, &info); 77 78 if (result == NULL) { 78 - dev_err(&adap->dev, "of_i2c: Failure registering %s\n", 79 - node->full_name); 79 + dev_err(&adap->dev, "of_i2c: Failure registering %pOF\n", node); 80 80 of_node_put(node); 81 81 return ERR_PTR(-EINVAL); 82 82 } ··· 104 106 client = of_i2c_register_device(adap, node); 105 107 if (IS_ERR(client)) { 106 108 dev_warn(&adap->dev, 107 - "Failed to create I2C device for %s\n", 108 - node->full_name); 109 + "Failed to create I2C device for %pOF\n", 110 + node); 109 111 of_node_clear_flag(node, OF_POPULATED); 110 112 } 111 113 } ··· 241 243 put_device(&adap->dev); 242 244 243 245 if (IS_ERR(client)) { 244 - dev_err(&adap->dev, "failed to create client for '%s'\n", 245 - rd->dn->full_name); 246 + dev_err(&adap->dev, "failed to create client for '%pOF'\n", 247 + rd->dn); 246 248 of_node_clear_flag(rd->dn, OF_POPULATED); 247 249 return notifier_from_errno(PTR_ERR(client)); 248 250 }
+2 -2
drivers/i2c/muxes/i2c-demux-pinctrl.c
··· 167 167 int count = 0, i; 168 168 169 169 for (i = 0; i < priv->num_chan && count < PAGE_SIZE; i++) 170 - count += scnprintf(buf + count, PAGE_SIZE - count, "%d:%s%c", 171 - i, priv->chan[i].parent_np->full_name, 170 + count += scnprintf(buf + count, PAGE_SIZE - count, "%d:%pOF%c", 171 + i, priv->chan[i].parent_np, 172 172 i == priv->num_chan - 1 ? '\n' : ' '); 173 173 174 174 return count;