diff options
author | Rob Herring <robh@kernel.org> | 2018-09-28 17:49:47 -0500 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2018-10-05 14:10:40 +0200 |
commit | 49d54abee9d1507e117a4218dc5baa3ebc5b93f1 (patch) | |
tree | 1492d76b77a4f9d341bbe542773aeb9965e9721f /drivers/i2c/busses | |
parent | e1eba2ea54a2de0e4c58d87270d25706bb77b844 (diff) | |
download | linux-49d54abee9d1507e117a4218dc5baa3ebc5b93f1.tar.bz2 |
i2c: Convert to using %pOFn instead of device_node.name
In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.
Reviewed-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/i2c-powermac.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c index f2a2067525ef..f6f4ed8afc93 100644 --- a/drivers/i2c/busses/i2c-powermac.c +++ b/drivers/i2c/busses/i2c-powermac.c @@ -388,9 +388,8 @@ static void i2c_powermac_register_devices(struct i2c_adapter *adap, static int i2c_powermac_probe(struct platform_device *dev) { struct pmac_i2c_bus *bus = dev_get_platdata(&dev->dev); - struct device_node *parent = NULL; + struct device_node *parent; struct i2c_adapter *adapter; - const char *basename; int rc; if (bus == NULL) @@ -407,23 +406,25 @@ static int i2c_powermac_probe(struct platform_device *dev) parent = of_get_parent(pmac_i2c_get_controller(bus)); if (parent == NULL) return -EINVAL; - basename = parent->name; + snprintf(adapter->name, sizeof(adapter->name), "%pOFn %d", + parent, + pmac_i2c_get_channel(bus)); + of_node_put(parent); break; case pmac_i2c_bus_pmu: - basename = "pmu"; + snprintf(adapter->name, sizeof(adapter->name), "pmu %d", + pmac_i2c_get_channel(bus)); break; case pmac_i2c_bus_smu: /* This is not what we used to do but I'm fixing drivers at * the same time as this change */ - basename = "smu"; + snprintf(adapter->name, sizeof(adapter->name), "smu %d", + pmac_i2c_get_channel(bus)); break; default: return -EINVAL; } - snprintf(adapter->name, sizeof(adapter->name), "%s %d", basename, - pmac_i2c_get_channel(bus)); - of_node_put(parent); platform_set_drvdata(dev, adapter); adapter->algo = &i2c_powermac_algorithm; |