From 4ae293ac5f55e0125d686be0ffb010bf231bb1cb Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Fri, 9 Nov 2012 14:04:51 +1100 Subject: [PATCH] drivers/of/fdt.c: re-use kernel's kbasename() Signed-off-by: Andy Shevchenko Acked-by: Grant Likely Cc: Rob Herring Signed-off-by: Andrew Morton --- drivers/of/fdt.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index c2b08dcdbc53..793b823842d9 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -487,14 +487,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; -- 2.39.5