Commit 83abc5a7 authored by Sakari Ailus's avatar Sakari Ailus Committed by Rafael J. Wysocki

lib/vsprintf: OF nodes are first and foremost, struct device_nodes

Factor out static kobject_string() function that simply calls
device_node_string(), and thus remove references to kobjects (as these are
struct device_node).
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent a92eb762
...@@ -1915,6 +1915,9 @@ char *device_node_string(char *buf, char *end, struct device_node *dn, ...@@ -1915,6 +1915,9 @@ char *device_node_string(char *buf, char *end, struct device_node *dn,
struct printf_spec str_spec = spec; struct printf_spec str_spec = spec;
str_spec.field_width = -1; str_spec.field_width = -1;
if (fmt[0] != 'F')
return error_string(buf, end, "(%pO?)", spec);
if (!IS_ENABLED(CONFIG_OF)) if (!IS_ENABLED(CONFIG_OF))
return error_string(buf, end, "(%pOF?)", spec); return error_string(buf, end, "(%pOF?)", spec);
...@@ -1988,17 +1991,6 @@ char *device_node_string(char *buf, char *end, struct device_node *dn, ...@@ -1988,17 +1991,6 @@ char *device_node_string(char *buf, char *end, struct device_node *dn,
return widen_string(buf, buf - buf_start, end, spec); return widen_string(buf, buf - buf_start, end, spec);
} }
static char *kobject_string(char *buf, char *end, void *ptr,
struct printf_spec spec, const char *fmt)
{
switch (fmt[1]) {
case 'F':
return device_node_string(buf, end, ptr, spec, fmt + 1);
}
return error_string(buf, end, "(%pO?)", spec);
}
/* /*
* Show a '%p' thing. A kernel extension is that the '%p' is followed * Show a '%p' thing. A kernel extension is that the '%p' is followed
* by an extra set of alphanumeric characters that are extended format * by an extra set of alphanumeric characters that are extended format
...@@ -2177,7 +2169,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, ...@@ -2177,7 +2169,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
case 'G': case 'G':
return flags_string(buf, end, ptr, spec, fmt); return flags_string(buf, end, ptr, spec, fmt);
case 'O': case 'O':
return kobject_string(buf, end, ptr, spec, fmt); return device_node_string(buf, end, ptr, spec, fmt + 1);
case 'x': case 'x':
return pointer_string(buf, end, ptr, spec); return pointer_string(buf, end, ptr, spec);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment