aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/rtas_pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/rtas_pci.c')
-rw-r--r--arch/powerpc/kernel/rtas_pci.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index 433a0a0949fb..3ab88a9dc70d 100644
--- a/arch/powerpc/kernel/rtas_pci.c
+++ b/arch/powerpc/kernel/rtas_pci.c
@@ -56,21 +56,6 @@ static inline int config_access_valid(struct pci_dn *dn, int where)
56 return 0; 56 return 0;
57} 57}
58 58
59static int of_device_available(struct device_node * dn)
60{
61 const char *status;
62
63 status = of_get_property(dn, "status", NULL);
64
65 if (!status)
66 return 1;
67
68 if (!strcmp(status, "okay"))
69 return 1;
70
71 return 0;
72}
73
74int rtas_read_config(struct pci_dn *pdn, int where, int size, u32 *val) 59int rtas_read_config(struct pci_dn *pdn, int where, int size, u32 *val)
75{ 60{
76 int returnval = -1; 61 int returnval = -1;
@@ -117,7 +102,7 @@ static int rtas_pci_read_config(struct pci_bus *bus,
117 for (dn = busdn->child; dn; dn = dn->sibling) { 102 for (dn = busdn->child; dn; dn = dn->sibling) {
118 struct pci_dn *pdn = PCI_DN(dn); 103 struct pci_dn *pdn = PCI_DN(dn);
119 if (pdn && pdn->devfn == devfn 104 if (pdn && pdn->devfn == devfn
120 && of_device_available(dn)) 105 && of_device_is_available(dn))
121 return rtas_read_config(pdn, where, size, val); 106 return rtas_read_config(pdn, where, size, val);
122 } 107 }
123 108
@@ -164,7 +149,7 @@ static int rtas_pci_write_config(struct pci_bus *bus,
164 for (dn = busdn->child; dn; dn = dn->sibling) { 149 for (dn = busdn->child; dn; dn = dn->sibling) {
165 struct pci_dn *pdn = PCI_DN(dn); 150 struct pci_dn *pdn = PCI_DN(dn);
166 if (pdn && pdn->devfn == devfn 151 if (pdn && pdn->devfn == devfn
167 && of_device_available(dn)) 152 && of_device_is_available(dn))
168 return rtas_write_config(pdn, where, size, val); 153 return rtas_write_config(pdn, where, size, val);
169 } 154 }
170 return PCIBIOS_DEVICE_NOT_FOUND; 155 return PCIBIOS_DEVICE_NOT_FOUND;
@@ -326,7 +311,7 @@ int pcibios_remove_root_bus(struct pci_controller *phb)
326 311
327 res = b->resource[0]; 312 res = b->resource[0];
328 if (!res->flags) { 313 if (!res->flags) {
329 printk(KERN_ERR "%s: no IO resource for PHB %s\n", __FUNCTION__, 314 printk(KERN_ERR "%s: no IO resource for PHB %s\n", __func__,
330 b->name); 315 b->name);
331 return 1; 316 return 1;
332 } 317 }
@@ -334,13 +319,13 @@ int pcibios_remove_root_bus(struct pci_controller *phb)
334 rc = pcibios_unmap_io_space(b); 319 rc = pcibios_unmap_io_space(b);
335 if (rc) { 320 if (rc) {
336 printk(KERN_ERR "%s: failed to unmap IO on bus %s\n", 321 printk(KERN_ERR "%s: failed to unmap IO on bus %s\n",
337 __FUNCTION__, b->name); 322 __func__, b->name);
338 return 1; 323 return 1;
339 } 324 }
340 325
341 if (release_resource(res)) { 326 if (release_resource(res)) {
342 printk(KERN_ERR "%s: failed to release IO on bus %s\n", 327 printk(KERN_ERR "%s: failed to release IO on bus %s\n",
343 __FUNCTION__, b->name); 328 __func__, b->name);
344 return 1; 329 return 1;
345 } 330 }
346 331
@@ -348,13 +333,13 @@ int pcibios_remove_root_bus(struct pci_controller *phb)
348 res = b->resource[i]; 333 res = b->resource[i];
349 if (!res->flags && i == 0) { 334 if (!res->flags && i == 0) {
350 printk(KERN_ERR "%s: no MEM resource for PHB %s\n", 335 printk(KERN_ERR "%s: no MEM resource for PHB %s\n",
351 __FUNCTION__, b->name); 336 __func__, b->name);
352 return 1; 337 return 1;
353 } 338 }
354 if (res->flags && release_resource(res)) { 339 if (res->flags && release_resource(res)) {
355 printk(KERN_ERR 340 printk(KERN_ERR
356 "%s: failed to release IO %d on bus %s\n", 341 "%s: failed to release IO %d on bus %s\n",
357 __FUNCTION__, i, b->name); 342 __func__, i, b->name);
358 return 1; 343 return 1;
359 } 344 }
360 } 345 }