Commit 06665989 authored by Rob Herring's avatar Rob Herring

powerpc: pseries: only store the device node basename in full_name

With dependencies on full_name containing the entire device node path
removed, stop storing the full_name in nodes created by
dlpar_configure_connector() and pSeries_reconfig_add_node().
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
parent 2bd6bf03
...@@ -75,24 +75,17 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa) ...@@ -75,24 +75,17 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa)
return prop; return prop;
} }
static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa, static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa)
const char *path)
{ {
struct device_node *dn; struct device_node *dn;
char *name; const char *name;
/* If parent node path is "/" advance path to NULL terminator to
* prevent double leading slashs in full_name.
*/
if (!path[1])
path++;
dn = kzalloc(sizeof(*dn), GFP_KERNEL); dn = kzalloc(sizeof(*dn), GFP_KERNEL);
if (!dn) if (!dn)
return NULL; return NULL;
name = (char *)ccwa + be32_to_cpu(ccwa->name_offset); name = (const char *)ccwa + be32_to_cpu(ccwa->name_offset);
dn->full_name = kasprintf(GFP_KERNEL, "%s/%s", path, name); dn->full_name = kstrdup(name, GFP_KERNEL);
if (!dn->full_name) { if (!dn->full_name) {
kfree(dn); kfree(dn);
return NULL; return NULL;
...@@ -148,7 +141,6 @@ struct device_node *dlpar_configure_connector(__be32 drc_index, ...@@ -148,7 +141,6 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
struct property *last_property = NULL; struct property *last_property = NULL;
struct cc_workarea *ccwa; struct cc_workarea *ccwa;
char *data_buf; char *data_buf;
const char *parent_path = parent->full_name;
int cc_token; int cc_token;
int rc = -1; int rc = -1;
...@@ -182,7 +174,7 @@ struct device_node *dlpar_configure_connector(__be32 drc_index, ...@@ -182,7 +174,7 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
break; break;
case NEXT_SIBLING: case NEXT_SIBLING:
dn = dlpar_parse_cc_node(ccwa, parent_path); dn = dlpar_parse_cc_node(ccwa);
if (!dn) if (!dn)
goto cc_error; goto cc_error;
...@@ -192,10 +184,7 @@ struct device_node *dlpar_configure_connector(__be32 drc_index, ...@@ -192,10 +184,7 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
break; break;
case NEXT_CHILD: case NEXT_CHILD:
if (first_dn) dn = dlpar_parse_cc_node(ccwa);
parent_path = last_dn->full_name;
dn = dlpar_parse_cc_node(ccwa, parent_path);
if (!dn) if (!dn)
goto cc_error; goto cc_error;
...@@ -226,7 +215,6 @@ struct device_node *dlpar_configure_connector(__be32 drc_index, ...@@ -226,7 +215,6 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
case PREV_PARENT: case PREV_PARENT:
last_dn = last_dn->parent; last_dn = last_dn->parent;
parent_path = last_dn->parent->full_name;
break; break;
case CALL_AGAIN: case CALL_AGAIN:
......
...@@ -33,7 +33,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist ...@@ -33,7 +33,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist
if (!np) if (!np)
goto out_err; goto out_err;
np->full_name = kstrdup(path, GFP_KERNEL); np->full_name = kstrdup(kbasename(path), GFP_KERNEL);
if (!np->full_name) if (!np->full_name)
goto out_err; goto out_err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment