aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/rtas_pci.c19
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c5
2 files changed, 4 insertions, 20 deletions
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c
index 945e8f4db873..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;
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 9eb539ee5f9a..550b2f7d2cc1 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -945,7 +945,6 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
945 unsigned int rets[3]; 945 unsigned int rets[3];
946 struct eeh_early_enable_info *info = data; 946 struct eeh_early_enable_info *info = data;
947 int ret; 947 int ret;
948 const char *status = of_get_property(dn, "status", NULL);
949 const u32 *class_code = of_get_property(dn, "class-code", NULL); 948 const u32 *class_code = of_get_property(dn, "class-code", NULL);
950 const u32 *vendor_id = of_get_property(dn, "vendor-id", NULL); 949 const u32 *vendor_id = of_get_property(dn, "vendor-id", NULL);
951 const u32 *device_id = of_get_property(dn, "device-id", NULL); 950 const u32 *device_id = of_get_property(dn, "device-id", NULL);
@@ -959,8 +958,8 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
959 pdn->eeh_freeze_count = 0; 958 pdn->eeh_freeze_count = 0;
960 pdn->eeh_false_positives = 0; 959 pdn->eeh_false_positives = 0;
961 960
962 if (status && strncmp(status, "ok", 2) != 0) 961 if (!of_device_is_available(dn))
963 return NULL; /* ignore devices with bad status */ 962 return NULL;
964 963
965 /* Ignore bad nodes. */ 964 /* Ignore bad nodes. */
966 if (!class_code || !vendor_id || !device_id) 965 if (!class_code || !vendor_id || !device_id)