mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-04-01 11:54:10 +00:00
drivers/of/fdt.c: re-use kernel's kbasename()
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Cc: Rob Herring <rob.herring@calxeda.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
b2e902f024
commit
375da3a76d
1 changed files with 2 additions and 8 deletions
|
@ -488,14 +488,8 @@ int __init of_scan_flat_dt(int (*it)(unsigned long node,
|
||||||
depth++;
|
depth++;
|
||||||
pathp = (char *)p;
|
pathp = (char *)p;
|
||||||
p = ALIGN(p + strlen(pathp) + 1, 4);
|
p = ALIGN(p + strlen(pathp) + 1, 4);
|
||||||
if ((*pathp) == '/') {
|
if (*pathp == '/')
|
||||||
const char *lp, *np;
|
pathp = kbasename(pathp);
|
||||||
for (lp = NULL, np = pathp; *np; np++)
|
|
||||||
if ((*np) == '/')
|
|
||||||
lp = np+1;
|
|
||||||
if (lp != NULL)
|
|
||||||
pathp = lp;
|
|
||||||
}
|
|
||||||
rc = it(p, pathp, depth, data);
|
rc = it(p, pathp, depth, data);
|
||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue