summaryrefslogtreecommitdiffstats
path: root/lib/vsprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vsprintf.c')
-rw-r--r--lib/vsprintf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index ad4fbe5bc730..37a54a6dd594 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1684,6 +1684,7 @@ char *device_node_string(char *buf, char *end, struct device_node *dn,
1684 fmt = "f"; 1684 fmt = "f";
1685 1685
1686 for (pass = false; strspn(fmt,"fnpPFcC"); fmt++, pass = true) { 1686 for (pass = false; strspn(fmt,"fnpPFcC"); fmt++, pass = true) {
1687 int precision;
1687 if (pass) { 1688 if (pass) {
1688 if (buf < end) 1689 if (buf < end)
1689 *buf = ':'; 1690 *buf = ':';
@@ -1695,7 +1696,11 @@ char *device_node_string(char *buf, char *end, struct device_node *dn,
1695 buf = device_node_gen_full_name(dn, buf, end); 1696 buf = device_node_gen_full_name(dn, buf, end);
1696 break; 1697 break;
1697 case 'n': /* name */ 1698 case 'n': /* name */
1698 buf = string(buf, end, dn->name, str_spec); 1699 p = kbasename(of_node_full_name(dn));
1700 precision = str_spec.precision;
1701 str_spec.precision = strchrnul(p, '@') - p;
1702 buf = string(buf, end, p, str_spec);
1703 str_spec.precision = precision;
1699 break; 1704 break;
1700 case 'p': /* phandle */ 1705 case 'p': /* phandle */
1701 buf = number(buf, end, (unsigned int)dn->phandle, num_spec); 1706 buf = number(buf, end, (unsigned int)dn->phandle, num_spec);