-static struct property *dup_and_fixup_symbol_prop(struct of_overlay *ov,
- const struct property *prop)
-{
- struct of_overlay_info *ovinfo;
- struct property *new;
- const char *overlay_name;
- char *label_path;
- char *symbol_path;
- const char *target_path;
- int k;
- int label_path_len;
- int overlay_name_len;
- int target_path_len;
-
- if (!prop->value)
- return NULL;
- symbol_path = prop->value;
-
- new = kzalloc(sizeof(*new), GFP_KERNEL);
- if (!new)
- return NULL;
-
- for (k = 0; k < ov->count; k++) {
- ovinfo = &ov->ovinfo_tab[k];
- overlay_name = ovinfo->overlay->full_name;
- overlay_name_len = strlen(overlay_name);
- if (!strncasecmp(symbol_path, overlay_name, overlay_name_len))
- break;
- }
-
- if (k >= ov->count)
- goto err_free;
-
- target_path = ovinfo->target->full_name;
- target_path_len = strlen(target_path);
-
- label_path = symbol_path + overlay_name_len;
- label_path_len = strlen(label_path);
-
- new->name = kstrdup(prop->name, GFP_KERNEL);
- new->length = target_path_len + label_path_len + 1;
- new->value = kzalloc(new->length, GFP_KERNEL);
-
- if (!new->name || !new->value)
- goto err_free;
-
- strcpy(new->value, target_path);
- strcpy(new->value + target_path_len, label_path);
-
- /* mark the property as dynamic */
- of_property_set_flag(new, OF_DYNAMIC);
-
- return new;
-
- err_free:
- kfree(new->name);
- kfree(new->value);
- kfree(new);
- return NULL;
-
-
-}
-