diff options
author | Rob Herring <robh@kernel.org> | 2018-08-27 20:00:19 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2018-09-07 11:04:41 -0500 |
commit | a613b26a50136ae90ab13943afe90bcbd34adb44 (patch) | |
tree | ae73468305d84211243721b857da21990ed11a8e /drivers/of/device.c | |
parent | 6901378c799d2358a2e4eff9818266df73c3b216 (diff) | |
download | linux-a613b26a50136ae90ab13943afe90bcbd34adb44.tar.bz2 |
of: 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: Frank Rowand <frank.rowand@sony.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/device.c')
-rw-r--r-- | drivers/of/device.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/of/device.c b/drivers/of/device.c index 5957cd4fa262..84e810421418 100644 --- a/drivers/of/device.c +++ b/drivers/of/device.c @@ -219,7 +219,8 @@ static ssize_t of_device_get_modalias(struct device *dev, char *str, ssize_t len return -ENODEV; /* Name & Type */ - csize = snprintf(str, len, "of:N%sT%s", dev->of_node->name, + /* %p eats all alphanum characters, so %c must be used here */ + csize = snprintf(str, len, "of:N%pOFn%c%s", dev->of_node, 'T', dev->of_node->type); tsize = csize; len -= csize; @@ -298,7 +299,7 @@ void of_device_uevent(struct device *dev, struct kobj_uevent_env *env) if ((!dev) || (!dev->of_node)) return; - add_uevent_var(env, "OF_NAME=%s", dev->of_node->name); + add_uevent_var(env, "OF_NAME=%pOFn", dev->of_node); add_uevent_var(env, "OF_FULLNAME=%pOF", dev->of_node); if (dev->of_node->type && strcmp("<NULL>", dev->of_node->type) != 0) add_uevent_var(env, "OF_TYPE=%s", dev->of_node->type); |