aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Fontenot <nfont@linux.vnet.ibm.com>2012-10-02 12:58:46 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-11-14 20:56:52 -0500
commit79d1c712958f94372482ad74578b00f44e744c12 (patch)
treeed26a9e56c56502c6f30496e7cbc367b54d950e7
parent1cf3d8b3d24cd383ddfd5442c83ec5c355ffc2f7 (diff)
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: Nathan Fontenot <nfont@linux.vnet.ibm.com> Acked-by: Geoff Levand <geoff@infradead.org> Acked-by: Rob Herring <rob.herring@calxeda.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/arm/mach-mxs/mach-mxs.c2
-rw-r--r--arch/powerpc/kernel/machine_kexec.c14
-rw-r--r--arch/powerpc/kernel/machine_kexec_64.c8
-rw-r--r--arch/powerpc/kernel/pci_32.c2
-rw-r--r--arch/powerpc/platforms/85xx/p1022_ds.c6
-rw-r--r--arch/powerpc/platforms/ps3/os-area.c6
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c4
-rw-r--r--arch/powerpc/platforms/pseries/mobility.c4
-rw-r--r--arch/powerpc/platforms/pseries/reconfig.c6
-rw-r--r--drivers/macintosh/smu.c2
-rw-r--r--drivers/of/base.c15
-rw-r--r--include/linux/of.h7
12 files changed, 37 insertions, 39 deletions
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c
index 4748ec551a6..d61b915ce52 100644
--- a/arch/arm/mach-mxs/mach-mxs.c
+++ b/arch/arm/mach-mxs/mach-mxs.c
@@ -211,7 +211,7 @@ static void __init update_fec_mac_prop(enum mac_oui oui)
211 macaddr[4] = (val >> 8) & 0xff; 211 macaddr[4] = (val >> 8) & 0xff;
212 macaddr[5] = (val >> 0) & 0xff; 212 macaddr[5] = (val >> 0) & 0xff;
213 213
214 prom_update_property(np, newmac); 214 of_update_property(np, newmac);
215 } 215 }
216} 216}
217 217
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index fa9f6c72f55..e1ec57e87b3 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -218,23 +218,23 @@ static void __init export_crashk_values(struct device_node *node)
218 * be sure what's in them, so remove them. */ 218 * be sure what's in them, so remove them. */
219 prop = of_find_property(node, "linux,crashkernel-base", NULL); 219 prop = of_find_property(node, "linux,crashkernel-base", NULL);
220 if (prop) 220 if (prop)
221 prom_remove_property(node, prop); 221 of_remove_property(node, prop);
222 222
223 prop = of_find_property(node, "linux,crashkernel-size", NULL); 223 prop = of_find_property(node, "linux,crashkernel-size", NULL);
224 if (prop) 224 if (prop)
225 prom_remove_property(node, prop); 225 of_remove_property(node, prop);
226 226
227 if (crashk_res.start != 0) { 227 if (crashk_res.start != 0) {
228 prom_add_property(node, &crashk_base_prop); 228 of_add_property(node, &crashk_base_prop);
229 crashk_size = resource_size(&crashk_res); 229 crashk_size = resource_size(&crashk_res);
230 prom_add_property(node, &crashk_size_prop); 230 of_add_property(node, &crashk_size_prop);
231 } 231 }
232 232
233 /* 233 /*
234 * memory_limit is required by the kexec-tools to limit the 234 * memory_limit is required by the kexec-tools to limit the
235 * crash regions to the actual memory used. 235 * crash regions to the actual memory used.
236 */ 236 */
237 prom_update_property(node, &memory_limit_prop); 237 of_update_property(node, &memory_limit_prop);
238} 238}
239 239
240static int __init kexec_setup(void) 240static int __init kexec_setup(void)
@@ -249,11 +249,11 @@ static int __init kexec_setup(void)
249 /* remove any stale properties so ours can be found */ 249 /* remove any stale properties so ours can be found */
250 prop = of_find_property(node, kernel_end_prop.name, NULL); 250 prop = of_find_property(node, kernel_end_prop.name, NULL);
251 if (prop) 251 if (prop)
252 prom_remove_property(node, prop); 252 of_remove_property(node, prop);
253 253
254 /* information needed by userspace when using default_machine_kexec */ 254 /* information needed by userspace when using default_machine_kexec */
255 kernel_end = __pa(_end); 255 kernel_end = __pa(_end);
256 prom_add_property(node, &kernel_end_prop); 256 of_add_property(node, &kernel_end_prop);
257 257
258 export_crashk_values(node); 258 export_crashk_values(node);
259 259
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index d7f609086a9..7206701b1ff 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -389,14 +389,14 @@ static int __init export_htab_values(void)
389 /* remove any stale propertys so ours can be found */ 389 /* remove any stale propertys so ours can be found */
390 prop = of_find_property(node, htab_base_prop.name, NULL); 390 prop = of_find_property(node, htab_base_prop.name, NULL);
391 if (prop) 391 if (prop)
392 prom_remove_property(node, prop); 392 of_remove_property(node, prop);
393 prop = of_find_property(node, htab_size_prop.name, NULL); 393 prop = of_find_property(node, htab_size_prop.name, NULL);
394 if (prop) 394 if (prop)
395 prom_remove_property(node, prop); 395 of_remove_property(node, prop);
396 396
397 htab_base = __pa(htab_address); 397 htab_base = __pa(htab_address);
398 prom_add_property(node, &htab_base_prop); 398 of_add_property(node, &htab_base_prop);
399 prom_add_property(node, &htab_size_prop); 399 of_add_property(node, &htab_size_prop);
400 400
401 of_node_put(node); 401 of_node_put(node);
402 return 0; 402 return 0;
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 4b06ec5a502..64f526a321f 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -208,7 +208,7 @@ pci_create_OF_bus_map(void)
208 of_prop->name = "pci-OF-bus-map"; 208 of_prop->name = "pci-OF-bus-map";
209 of_prop->length = 256; 209 of_prop->length = 256;
210 of_prop->value = &of_prop[1]; 210 of_prop->value = &of_prop[1];
211 prom_add_property(dn, of_prop); 211 of_add_property(dn, of_prop);
212 of_node_put(dn); 212 of_node_put(dn);
213 } 213 }
214} 214}
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c
index 848a3e98e1c..8fb12570b2f 100644
--- a/arch/powerpc/platforms/85xx/p1022_ds.c
+++ b/arch/powerpc/platforms/85xx/p1022_ds.c
@@ -539,7 +539,7 @@ static void __init p1022_ds_setup_arch(void)
539 }; 539 };
540 540
541 /* 541 /*
542 * prom_update_property() is called before 542 * of_update_property() is called before
543 * kmalloc() is available, so the 'new' object 543 * kmalloc() is available, so the 'new' object
544 * should be allocated in the global area. 544 * should be allocated in the global area.
545 * The easiest way is to do that is to 545 * The easiest way is to do that is to
@@ -548,7 +548,7 @@ static void __init p1022_ds_setup_arch(void)
548 */ 548 */
549 pr_info("p1022ds: disabling %s node", 549 pr_info("p1022ds: disabling %s node",
550 np2->full_name); 550 np2->full_name);
551 prom_update_property(np2, &nor_status); 551 of_update_property(np2, &nor_status);
552 of_node_put(np2); 552 of_node_put(np2);
553 } 553 }
554 554
@@ -564,7 +564,7 @@ static void __init p1022_ds_setup_arch(void)
564 564
565 pr_info("p1022ds: disabling %s node", 565 pr_info("p1022ds: disabling %s node",
566 np2->full_name); 566 np2->full_name);
567 prom_update_property(np2, &nand_status); 567 of_update_property(np2, &nand_status);
568 of_node_put(np2); 568 of_node_put(np2);
569 } 569 }
570 570
diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c
index 56d26bc4fd4..09787139834 100644
--- a/arch/powerpc/platforms/ps3/os-area.c
+++ b/arch/powerpc/platforms/ps3/os-area.c
@@ -280,13 +280,13 @@ static void os_area_set_property(struct device_node *node,
280 280
281 if (tmp) { 281 if (tmp) {
282 pr_debug("%s:%d found %s\n", __func__, __LINE__, prop->name); 282 pr_debug("%s:%d found %s\n", __func__, __LINE__, prop->name);
283 prom_remove_property(node, tmp); 283 of_remove_property(node, tmp);
284 } 284 }
285 285
286 result = prom_add_property(node, prop); 286 result = of_add_property(node, prop);
287 287
288 if (result) 288 if (result)
289 pr_debug("%s:%d prom_set_property failed\n", __func__, 289 pr_debug("%s:%d of_set_property failed\n", __func__,
290 __LINE__); 290 __LINE__);
291} 291}
292 292
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index da5594c441e..e2685badb5d 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -760,7 +760,7 @@ static void remove_ddw(struct device_node *np)
760 __remove_ddw(np, ddw_avail, liobn); 760 __remove_ddw(np, ddw_avail, liobn);
761 761
762delprop: 762delprop:
763 ret = prom_remove_property(np, win64); 763 ret = of_remove_property(np, win64);
764 if (ret) 764 if (ret)
765 pr_warning("%s: failed to remove direct window property: %d\n", 765 pr_warning("%s: failed to remove direct window property: %d\n",
766 np->full_name, ret); 766 np->full_name, ret);
@@ -1070,7 +1070,7 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn)
1070 goto out_free_window; 1070 goto out_free_window;
1071 } 1071 }
1072 1072
1073 ret = prom_add_property(pdn, win64); 1073 ret = of_add_property(pdn, win64);
1074 if (ret) { 1074 if (ret) {
1075 dev_err(&dev->dev, "unable to add dma window property for %s: %d", 1075 dev_err(&dev->dev, "unable to add dma window property for %s: %d",
1076 pdn->full_name, ret); 1076 pdn->full_name, ret);
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index dd30b12edfe..6573808cc5f 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -116,7 +116,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop,
116 } 116 }
117 117
118 if (!more) { 118 if (!more) {
119 prom_update_property(dn, new_prop); 119 of_update_property(dn, new_prop);
120 new_prop = NULL; 120 new_prop = NULL;
121 } 121 }
122 122
@@ -172,7 +172,7 @@ static int update_dt_node(u32 phandle)
172 172
173 case 0x80000000: 173 case 0x80000000:
174 prop = of_find_property(dn, prop_name, NULL); 174 prop = of_find_property(dn, prop_name, NULL);
175 prom_remove_property(dn, prop); 175 of_remove_property(dn, prop);
176 prop = NULL; 176 prop = NULL;
177 break; 177 break;
178 178
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index 720a0cc2e69..30b358dc2be 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -326,7 +326,7 @@ static int do_add_property(char *buf, size_t bufsize)
326 if (!prop) 326 if (!prop)
327 return -ENOMEM; 327 return -ENOMEM;
328 328
329 prom_add_property(np, prop); 329 of_add_property(np, prop);
330 330
331 return 0; 331 return 0;
332} 332}
@@ -350,7 +350,7 @@ static int do_remove_property(char *buf, size_t bufsize)
350 350
351 prop = of_find_property(np, buf, NULL); 351 prop = of_find_property(np, buf, NULL);
352 352
353 return prom_remove_property(np, prop); 353 return of_remove_property(np, prop);
354} 354}
355 355
356static int do_update_property(char *buf, size_t bufsize) 356static int do_update_property(char *buf, size_t bufsize)
@@ -380,7 +380,7 @@ static int do_update_property(char *buf, size_t bufsize)
380 if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size")) 380 if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size"))
381 slb_set_size(*(int *)value); 381 slb_set_size(*(int *)value);
382 382
383 return prom_update_property(np, newprop); 383 return of_update_property(np, newprop);
384} 384}
385 385
386/** 386/**
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
index 7d5a6b40b31..5b939509db3 100644
--- a/drivers/macintosh/smu.c
+++ b/drivers/macintosh/smu.c
@@ -997,7 +997,7 @@ static struct smu_sdbp_header *smu_create_sdb_partition(int id)
997 "%02x !\n", id, hdr->id); 997 "%02x !\n", id, hdr->id);
998 goto failure; 998 goto failure;
999 } 999 }
1000 if (prom_add_property(smu->of_node, prop)) { 1000 if (of_add_property(smu->of_node, prop)) {
1001 printk(KERN_DEBUG "SMU: Failed creating sdb-partition-%02x " 1001 printk(KERN_DEBUG "SMU: Failed creating sdb-partition-%02x "
1002 "property !\n", id); 1002 "property !\n", id);
1003 goto failure; 1003 goto failure;
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 87b63850e8d..02d94c4ea83 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1047,9 +1047,9 @@ static int of_property_notify(int action, struct device_node *np,
1047#endif 1047#endif
1048 1048
1049/** 1049/**
1050 * prom_add_property - Add a property to a node 1050 * of_add_property - Add a property to a node
1051 */ 1051 */
1052int prom_add_property(struct device_node *np, struct property *prop) 1052int of_add_property(struct device_node *np, struct property *prop)
1053{ 1053{
1054 struct property **next; 1054 struct property **next;
1055 unsigned long flags; 1055 unsigned long flags;
@@ -1083,14 +1083,14 @@ int prom_add_property(struct device_node *np, struct property *prop)
1083} 1083}
1084 1084
1085/** 1085/**
1086 * prom_remove_property - Remove a property from a node. 1086 * of_remove_property - Remove a property from a node.
1087 * 1087 *
1088 * Note that we don't actually remove it, since we have given out 1088 * Note that we don't actually remove it, since we have given out
1089 * who-knows-how-many pointers to the data using get-property. 1089 * who-knows-how-many pointers to the data using get-property.
1090 * Instead we just move the property to the "dead properties" 1090 * Instead we just move the property to the "dead properties"
1091 * list, so it won't be found any more. 1091 * list, so it won't be found any more.
1092 */ 1092 */
1093int prom_remove_property(struct device_node *np, struct property *prop) 1093int of_remove_property(struct device_node *np, struct property *prop)
1094{ 1094{
1095 struct property **next; 1095 struct property **next;
1096 unsigned long flags; 1096 unsigned long flags;
@@ -1129,7 +1129,7 @@ int prom_remove_property(struct device_node *np, struct property *prop)
1129} 1129}
1130 1130
1131/* 1131/*
1132 * prom_update_property - Update a property in a node, if the property does 1132 * of_update_property - Update a property in a node, if the property does
1133 * not exist, add it. 1133 * not exist, add it.
1134 * 1134 *
1135 * Note that we don't actually remove it, since we have given out 1135 * 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 * Instead we just move the property to the "dead properties" list, 1137 * Instead we just move the property to the "dead properties" list,
1138 * and add the new property to the property list 1138 * and add the new property to the property list
1139 */ 1139 */
1140int prom_update_property(struct device_node *np, 1140int of_update_property(struct device_node *np, struct property *newprop)
1141 struct property *newprop)
1142{ 1141{
1143 struct property **next, *oldprop; 1142 struct property **next, *oldprop;
1144 unsigned long flags; 1143 unsigned long flags;
@@ -1153,7 +1152,7 @@ int prom_update_property(struct device_node *np,
1153 1152
1154 oldprop = of_find_property(np, newprop->name, NULL); 1153 oldprop = of_find_property(np, newprop->name, NULL);
1155 if (!oldprop) 1154 if (!oldprop)
1156 return prom_add_property(np, newprop); 1155 return of_add_property(np, newprop);
1157 1156
1158 write_lock_irqsave(&devtree_lock, flags); 1157 write_lock_irqsave(&devtree_lock, flags);
1159 next = &np->properties; 1158 next = &np->properties;
diff --git a/include/linux/of.h b/include/linux/of.h
index fb5d87b66e3..a093b2fe5df 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -268,10 +268,9 @@ extern int of_alias_get_id(struct device_node *np, const char *stem);
268 268
269extern int of_machine_is_compatible(const char *compat); 269extern int of_machine_is_compatible(const char *compat);
270 270
271extern int prom_add_property(struct device_node* np, struct property* prop); 271extern int of_add_property(struct device_node *np, struct property *prop);
272extern int prom_remove_property(struct device_node *np, struct property *prop); 272extern int of_remove_property(struct device_node *np, struct property *prop);
273extern int prom_update_property(struct device_node *np, 273extern int of_update_property(struct device_node *np, struct property *newprop);
274 struct property *newprop);
275 274
276/* For updating the device tree at runtime */ 275/* For updating the device tree at runtime */
277#define OF_RECONFIG_ATTACH_NODE 0x0001 276#define OF_RECONFIG_ATTACH_NODE 0x0001