Commit 79d1c712 authored by Nathan Fontenot's avatar Nathan Fontenot Committed by Benjamin Herrenschmidt

powerpc+of: Rename the drivers/of prom_* functions to of_*

Rename the prom_*_property routines of the generic OF code to of_*_property.
This brings them in line with the naming used by the rest of the OF code.
Signed-off-by: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
Acked-by: default avatarGeoff Levand <geoff@infradead.org>
Acked-by: default avatarRob Herring <rob.herring@calxeda.com>
Acked-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 1cf3d8b3
...@@ -211,7 +211,7 @@ static void __init update_fec_mac_prop(enum mac_oui oui) ...@@ -211,7 +211,7 @@ static void __init update_fec_mac_prop(enum mac_oui oui)
macaddr[4] = (val >> 8) & 0xff; macaddr[4] = (val >> 8) & 0xff;
macaddr[5] = (val >> 0) & 0xff; macaddr[5] = (val >> 0) & 0xff;
prom_update_property(np, newmac); of_update_property(np, newmac);
} }
} }
......
...@@ -218,23 +218,23 @@ static void __init export_crashk_values(struct device_node *node) ...@@ -218,23 +218,23 @@ static void __init export_crashk_values(struct device_node *node)
* be sure what's in them, so remove them. */ * be sure what's in them, so remove them. */
prop = of_find_property(node, "linux,crashkernel-base", NULL); prop = of_find_property(node, "linux,crashkernel-base", NULL);
if (prop) if (prop)
prom_remove_property(node, prop); of_remove_property(node, prop);
prop = of_find_property(node, "linux,crashkernel-size", NULL); prop = of_find_property(node, "linux,crashkernel-size", NULL);
if (prop) if (prop)
prom_remove_property(node, prop); of_remove_property(node, prop);
if (crashk_res.start != 0) { if (crashk_res.start != 0) {
prom_add_property(node, &crashk_base_prop); of_add_property(node, &crashk_base_prop);
crashk_size = resource_size(&crashk_res); crashk_size = resource_size(&crashk_res);
prom_add_property(node, &crashk_size_prop); of_add_property(node, &crashk_size_prop);
} }
/* /*
* memory_limit is required by the kexec-tools to limit the * memory_limit is required by the kexec-tools to limit the
* crash regions to the actual memory used. * crash regions to the actual memory used.
*/ */
prom_update_property(node, &memory_limit_prop); of_update_property(node, &memory_limit_prop);
} }
static int __init kexec_setup(void) static int __init kexec_setup(void)
...@@ -249,11 +249,11 @@ static int __init kexec_setup(void) ...@@ -249,11 +249,11 @@ static int __init kexec_setup(void)
/* remove any stale properties so ours can be found */ /* remove any stale properties so ours can be found */
prop = of_find_property(node, kernel_end_prop.name, NULL); prop = of_find_property(node, kernel_end_prop.name, NULL);
if (prop) if (prop)
prom_remove_property(node, prop); of_remove_property(node, prop);
/* information needed by userspace when using default_machine_kexec */ /* information needed by userspace when using default_machine_kexec */
kernel_end = __pa(_end); kernel_end = __pa(_end);
prom_add_property(node, &kernel_end_prop); of_add_property(node, &kernel_end_prop);
export_crashk_values(node); export_crashk_values(node);
......
...@@ -389,14 +389,14 @@ static int __init export_htab_values(void) ...@@ -389,14 +389,14 @@ static int __init export_htab_values(void)
/* remove any stale propertys so ours can be found */ /* remove any stale propertys so ours can be found */
prop = of_find_property(node, htab_base_prop.name, NULL); prop = of_find_property(node, htab_base_prop.name, NULL);
if (prop) if (prop)
prom_remove_property(node, prop); of_remove_property(node, prop);
prop = of_find_property(node, htab_size_prop.name, NULL); prop = of_find_property(node, htab_size_prop.name, NULL);
if (prop) if (prop)
prom_remove_property(node, prop); of_remove_property(node, prop);
htab_base = __pa(htab_address); htab_base = __pa(htab_address);
prom_add_property(node, &htab_base_prop); of_add_property(node, &htab_base_prop);
prom_add_property(node, &htab_size_prop); of_add_property(node, &htab_size_prop);
of_node_put(node); of_node_put(node);
return 0; return 0;
......
...@@ -208,7 +208,7 @@ pci_create_OF_bus_map(void) ...@@ -208,7 +208,7 @@ pci_create_OF_bus_map(void)
of_prop->name = "pci-OF-bus-map"; of_prop->name = "pci-OF-bus-map";
of_prop->length = 256; of_prop->length = 256;
of_prop->value = &of_prop[1]; of_prop->value = &of_prop[1];
prom_add_property(dn, of_prop); of_add_property(dn, of_prop);
of_node_put(dn); of_node_put(dn);
} }
} }
......
...@@ -539,7 +539,7 @@ static void __init p1022_ds_setup_arch(void) ...@@ -539,7 +539,7 @@ static void __init p1022_ds_setup_arch(void)
}; };
/* /*
* prom_update_property() is called before * of_update_property() is called before
* kmalloc() is available, so the 'new' object * kmalloc() is available, so the 'new' object
* should be allocated in the global area. * should be allocated in the global area.
* The easiest way is to do that is to * The easiest way is to do that is to
...@@ -548,7 +548,7 @@ static void __init p1022_ds_setup_arch(void) ...@@ -548,7 +548,7 @@ static void __init p1022_ds_setup_arch(void)
*/ */
pr_info("p1022ds: disabling %s node", pr_info("p1022ds: disabling %s node",
np2->full_name); np2->full_name);
prom_update_property(np2, &nor_status); of_update_property(np2, &nor_status);
of_node_put(np2); of_node_put(np2);
} }
...@@ -564,7 +564,7 @@ static void __init p1022_ds_setup_arch(void) ...@@ -564,7 +564,7 @@ static void __init p1022_ds_setup_arch(void)
pr_info("p1022ds: disabling %s node", pr_info("p1022ds: disabling %s node",
np2->full_name); np2->full_name);
prom_update_property(np2, &nand_status); of_update_property(np2, &nand_status);
of_node_put(np2); of_node_put(np2);
} }
......
...@@ -280,13 +280,13 @@ static void os_area_set_property(struct device_node *node, ...@@ -280,13 +280,13 @@ static void os_area_set_property(struct device_node *node,
if (tmp) { if (tmp) {
pr_debug("%s:%d found %s\n", __func__, __LINE__, prop->name); pr_debug("%s:%d found %s\n", __func__, __LINE__, prop->name);
prom_remove_property(node, tmp); of_remove_property(node, tmp);
} }
result = prom_add_property(node, prop); result = of_add_property(node, prop);
if (result) if (result)
pr_debug("%s:%d prom_set_property failed\n", __func__, pr_debug("%s:%d of_set_property failed\n", __func__,
__LINE__); __LINE__);
} }
......
...@@ -760,7 +760,7 @@ static void remove_ddw(struct device_node *np) ...@@ -760,7 +760,7 @@ static void remove_ddw(struct device_node *np)
__remove_ddw(np, ddw_avail, liobn); __remove_ddw(np, ddw_avail, liobn);
delprop: delprop:
ret = prom_remove_property(np, win64); ret = of_remove_property(np, win64);
if (ret) if (ret)
pr_warning("%s: failed to remove direct window property: %d\n", pr_warning("%s: failed to remove direct window property: %d\n",
np->full_name, ret); np->full_name, ret);
...@@ -1070,7 +1070,7 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn) ...@@ -1070,7 +1070,7 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
goto out_free_window; goto out_free_window;
} }
ret = prom_add_property(pdn, win64); ret = of_add_property(pdn, win64);
if (ret) { if (ret) {
dev_err(&dev->dev, "unable to add dma window property for %s: %d", dev_err(&dev->dev, "unable to add dma window property for %s: %d",
pdn->full_name, ret); pdn->full_name, ret);
......
...@@ -116,7 +116,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop, ...@@ -116,7 +116,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop,
} }
if (!more) { if (!more) {
prom_update_property(dn, new_prop); of_update_property(dn, new_prop);
new_prop = NULL; new_prop = NULL;
} }
...@@ -172,7 +172,7 @@ static int update_dt_node(u32 phandle) ...@@ -172,7 +172,7 @@ static int update_dt_node(u32 phandle)
case 0x80000000: case 0x80000000:
prop = of_find_property(dn, prop_name, NULL); prop = of_find_property(dn, prop_name, NULL);
prom_remove_property(dn, prop); of_remove_property(dn, prop);
prop = NULL; prop = NULL;
break; break;
......
...@@ -326,7 +326,7 @@ static int do_add_property(char *buf, size_t bufsize) ...@@ -326,7 +326,7 @@ static int do_add_property(char *buf, size_t bufsize)
if (!prop) if (!prop)
return -ENOMEM; return -ENOMEM;
prom_add_property(np, prop); of_add_property(np, prop);
return 0; return 0;
} }
...@@ -350,7 +350,7 @@ static int do_remove_property(char *buf, size_t bufsize) ...@@ -350,7 +350,7 @@ static int do_remove_property(char *buf, size_t bufsize)
prop = of_find_property(np, buf, NULL); prop = of_find_property(np, buf, NULL);
return prom_remove_property(np, prop); return of_remove_property(np, prop);
} }
static int do_update_property(char *buf, size_t bufsize) static int do_update_property(char *buf, size_t bufsize)
...@@ -380,7 +380,7 @@ static int do_update_property(char *buf, size_t bufsize) ...@@ -380,7 +380,7 @@ static int do_update_property(char *buf, size_t bufsize)
if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size")) if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size"))
slb_set_size(*(int *)value); slb_set_size(*(int *)value);
return prom_update_property(np, newprop); return of_update_property(np, newprop);
} }
/** /**
......
...@@ -997,7 +997,7 @@ static struct smu_sdbp_header *smu_create_sdb_partition(int id) ...@@ -997,7 +997,7 @@ static struct smu_sdbp_header *smu_create_sdb_partition(int id)
"%02x !\n", id, hdr->id); "%02x !\n", id, hdr->id);
goto failure; goto failure;
} }
if (prom_add_property(smu->of_node, prop)) { if (of_add_property(smu->of_node, prop)) {
printk(KERN_DEBUG "SMU: Failed creating sdb-partition-%02x " printk(KERN_DEBUG "SMU: Failed creating sdb-partition-%02x "
"property !\n", id); "property !\n", id);
goto failure; goto failure;
......
...@@ -1047,9 +1047,9 @@ static int of_property_notify(int action, struct device_node *np, ...@@ -1047,9 +1047,9 @@ static int of_property_notify(int action, struct device_node *np,
#endif #endif
/** /**
* prom_add_property - Add a property to a node * of_add_property - Add a property to a node
*/ */
int prom_add_property(struct device_node *np, struct property *prop) int of_add_property(struct device_node *np, struct property *prop)
{ {
struct property **next; struct property **next;
unsigned long flags; unsigned long flags;
...@@ -1083,14 +1083,14 @@ int prom_add_property(struct device_node *np, struct property *prop) ...@@ -1083,14 +1083,14 @@ int prom_add_property(struct device_node *np, struct property *prop)
} }
/** /**
* prom_remove_property - Remove a property from a node. * of_remove_property - Remove a property from a node.
* *
* Note that we don't actually remove it, since we have given out * Note that we don't actually remove it, since we have given out
* who-knows-how-many pointers to the data using get-property. * who-knows-how-many pointers to the data using get-property.
* Instead we just move the property to the "dead properties" * Instead we just move the property to the "dead properties"
* list, so it won't be found any more. * list, so it won't be found any more.
*/ */
int prom_remove_property(struct device_node *np, struct property *prop) int of_remove_property(struct device_node *np, struct property *prop)
{ {
struct property **next; struct property **next;
unsigned long flags; unsigned long flags;
...@@ -1129,7 +1129,7 @@ int prom_remove_property(struct device_node *np, struct property *prop) ...@@ -1129,7 +1129,7 @@ int prom_remove_property(struct device_node *np, struct property *prop)
} }
/* /*
* prom_update_property - Update a property in a node, if the property does * of_update_property - Update a property in a node, if the property does
* not exist, add it. * not exist, add it.
* *
* Note that we don't actually remove it, since we have given out * Note that we don't actually remove it, since we have given out
...@@ -1137,8 +1137,7 @@ int prom_remove_property(struct device_node *np, struct property *prop) ...@@ -1137,8 +1137,7 @@ int prom_remove_property(struct device_node *np, struct property *prop)
* Instead we just move the property to the "dead properties" list, * Instead we just move the property to the "dead properties" list,
* and add the new property to the property list * and add the new property to the property list
*/ */
int prom_update_property(struct device_node *np, int of_update_property(struct device_node *np, struct property *newprop)
struct property *newprop)
{ {
struct property **next, *oldprop; struct property **next, *oldprop;
unsigned long flags; unsigned long flags;
...@@ -1153,7 +1152,7 @@ int prom_update_property(struct device_node *np, ...@@ -1153,7 +1152,7 @@ int prom_update_property(struct device_node *np,
oldprop = of_find_property(np, newprop->name, NULL); oldprop = of_find_property(np, newprop->name, NULL);
if (!oldprop) if (!oldprop)
return prom_add_property(np, newprop); return of_add_property(np, newprop);
write_lock_irqsave(&devtree_lock, flags); write_lock_irqsave(&devtree_lock, flags);
next = &np->properties; next = &np->properties;
......
...@@ -268,10 +268,9 @@ extern int of_alias_get_id(struct device_node *np, const char *stem); ...@@ -268,10 +268,9 @@ extern int of_alias_get_id(struct device_node *np, const char *stem);
extern int of_machine_is_compatible(const char *compat); extern int of_machine_is_compatible(const char *compat);
extern int prom_add_property(struct device_node* np, struct property* prop); extern int of_add_property(struct device_node *np, struct property *prop);
extern int prom_remove_property(struct device_node *np, struct property *prop); extern int of_remove_property(struct device_node *np, struct property *prop);
extern int prom_update_property(struct device_node *np, extern int of_update_property(struct device_node *np, struct property *newprop);
struct property *newprop);
/* For updating the device tree at runtime */ /* For updating the device tree at runtime */
#define OF_RECONFIG_ATTACH_NODE 0x0001 #define OF_RECONFIG_ATTACH_NODE 0x0001
......
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