|
@@ -75,24 +75,17 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa)
|
|
|
return prop;
|
|
|
}
|
|
|
|
|
|
-static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa,
|
|
|
- const char *path)
|
|
|
+static struct device_node *dlpar_parse_cc_node(struct cc_workarea *ccwa)
|
|
|
{
|
|
|
struct device_node *dn;
|
|
|
- char *name;
|
|
|
-
|
|
|
- /* If parent node path is "/" advance path to NULL terminator to
|
|
|
- * prevent double leading slashs in full_name.
|
|
|
- */
|
|
|
- if (!path[1])
|
|
|
- path++;
|
|
|
+ const char *name;
|
|
|
|
|
|
dn = kzalloc(sizeof(*dn), GFP_KERNEL);
|
|
|
if (!dn)
|
|
|
return NULL;
|
|
|
|
|
|
- name = (char *)ccwa + be32_to_cpu(ccwa->name_offset);
|
|
|
- dn->full_name = kasprintf(GFP_KERNEL, "%s/%s", path, name);
|
|
|
+ name = (const char *)ccwa + be32_to_cpu(ccwa->name_offset);
|
|
|
+ dn->full_name = kstrdup(name, GFP_KERNEL);
|
|
|
if (!dn->full_name) {
|
|
|
kfree(dn);
|
|
|
return NULL;
|
|
@@ -148,7 +141,6 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
|
|
|
struct property *last_property = NULL;
|
|
|
struct cc_workarea *ccwa;
|
|
|
char *data_buf;
|
|
|
- const char *parent_path = parent->full_name;
|
|
|
int cc_token;
|
|
|
int rc = -1;
|
|
|
|
|
@@ -182,7 +174,7 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
|
|
|
break;
|
|
|
|
|
|
case NEXT_SIBLING:
|
|
|
- dn = dlpar_parse_cc_node(ccwa, parent_path);
|
|
|
+ dn = dlpar_parse_cc_node(ccwa);
|
|
|
if (!dn)
|
|
|
goto cc_error;
|
|
|
|
|
@@ -192,10 +184,7 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
|
|
|
break;
|
|
|
|
|
|
case NEXT_CHILD:
|
|
|
- if (first_dn)
|
|
|
- parent_path = last_dn->full_name;
|
|
|
-
|
|
|
- dn = dlpar_parse_cc_node(ccwa, parent_path);
|
|
|
+ dn = dlpar_parse_cc_node(ccwa);
|
|
|
if (!dn)
|
|
|
goto cc_error;
|
|
|
|
|
@@ -226,7 +215,6 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
|
|
|
|
|
|
case PREV_PARENT:
|
|
|
last_dn = last_dn->parent;
|
|
|
- parent_path = last_dn->parent->full_name;
|
|
|
break;
|
|
|
|
|
|
case CALL_AGAIN:
|