Merge tag 'stable/for-linus-3.8-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / drivers / of / fdt.c
index a65c39c473bf36368493bd794222ab45d328706c..808be06bb67e7d4eeaf4f7250fae2dace0cc0f8d 100644 (file)
@@ -488,14 +488,8 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node,
                depth++;
                pathp = (char *)p;
                p = ALIGN(p + strlen(pathp) + 1, 4);
-               if ((*pathp) == '/') {
-                       const char *lp, *np;
-                       for (lp = NULL, np = pathp; *np; np++)
-                               if ((*np) == '/')
-                                       lp = np+1;
-                       if (lp != NULL)
-                               pathp = lp;
-               }
+               if (*pathp == '/')
+                       pathp = kbasename(pathp);
                rc = it(p, pathp, depth, data);
                if (rc != 0)
                        break;