]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
procfs: use kbasename()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 9 Nov 2012 03:04:50 +0000 (14:04 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 14 Nov 2012 04:55:14 +0000 (15:55 +1100)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/proc/proc_devtree.c

index df7dd08d439121253bb180e26ad4d7e982775adf..3d9fd6674c719af68205a2bff350f768c198a971 100644 (file)
@@ -13,6 +13,7 @@
 #include <linux/of.h>
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/string.h>
 #include <asm/prom.h>
 #include <asm/uaccess.h>
 #include "internal.h"
@@ -195,11 +196,7 @@ void proc_device_tree_add_node(struct device_node *np,
        set_node_proc_entry(np, de);
        for (child = NULL; (child = of_get_next_child(np, child));) {
                /* Use everything after the last slash, or the full name */
-               p = strrchr(child->full_name, '/');
-               if (!p)
-                       p = child->full_name;
-               else
-                       ++p;
+               p = kbasename(child->full_name);
 
                if (duplicate_name(de, p))
                        p = fixup_name(np, de, p);