aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorNathan Lynch <ntl@pobox.com>2008-03-13 15:52:10 -0400
committerPaul Mackerras <paulus@samba.org>2008-04-06 23:49:25 -0400
commitc6d4d5a8a83e4a564bcf233fdd565183c33df5d1 (patch)
tree801bfb328121f02df9e78380eb25f325ea2a41cb /arch/powerpc/kernel
parent834d97d452208279edf11c57eca150360d2dd1d6 (diff)
[POWERPC] Convert pci and eeh code to of_device_is_available
A couple of places are duplicating the function of of_device_is_available; convert them to use it. Signed-off-by: Nathan Lynch <ntl@pobox.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/rtas_pci.c19
1 files changed, 2 insertions, 17 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;