Skip to contentSkip to conversation

of: re-use kernel's kbasename()

PATCH RESEND New Andy Shevchenko 1 participant 1 message Nov 5, 2012 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 of: re-use kernel's kbasename()

---
 drivers/of/fdt.c |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/of/fdt.c +2 -8
index 91a375f..0ca0f9e 100644
@@ -486,14 +486,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) == '/') {
-			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;
Signature · 1 line
1.7.10.4