Skip to content

Commit

Permalink
vsprintf: print OF node name using full_name
Browse files Browse the repository at this point in the history
In preparation to remove the node name pointer from struct device_node,
convert the node name print to get the node name from the full name.

Reviewed-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
  • Loading branch information
Rob Herring committed Sep 7, 2018
1 parent a613b26 commit 6d0a70a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/vsprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,7 @@ char *device_node_string(char *buf, char *end, struct device_node *dn,
fmt = "f";

for (pass = false; strspn(fmt,"fnpPFcC"); fmt++, pass = true) {
int precision;
if (pass) {
if (buf < end)
*buf = ':';
Expand All @@ -1607,7 +1608,11 @@ char *device_node_string(char *buf, char *end, struct device_node *dn,
buf = device_node_gen_full_name(dn, buf, end);
break;
case 'n': /* name */
buf = string(buf, end, dn->name, str_spec);
p = kbasename(of_node_full_name(dn));
precision = str_spec.precision;
str_spec.precision = strchrnul(p, '@') - p;
buf = string(buf, end, p, str_spec);
str_spec.precision = precision;
break;
case 'p': /* phandle */
buf = number(buf, end, (unsigned int)dn->phandle, num_spec);
Expand Down

0 comments on commit 6d0a70a

Please sign in to comment.