Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6187
b: refs/heads/master
c: 293da76
h: refs/heads/master
i:
  6185: 3b78f08
  6183: de5445d
v: v3
  • Loading branch information
Jake Moilanen authored and Paul Mackerras committed Aug 29, 2005
1 parent bf1c77f commit 62b965d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 34153fa3af45d84f3221d9b67ba2ab7e8a220d28
refs/heads/master: 293da76b3d4c2f362f906bce8c5d2e053bdf8d44
19 changes: 17 additions & 2 deletions trunk/arch/ppc64/kernel/rtas_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,21 @@ static int config_access_valid(struct device_node *dn, int where)
return 0;
}

static int of_device_available(struct device_node * dn)
{
char * status;

status = get_property(dn, "status", NULL);

if (!status)
return 1;

if (!strcmp(status, "okay"))
return 1;

return 0;
}

static int rtas_read_config(struct device_node *dn, int where, int size, u32 *val)
{
int returnval = -1;
Expand Down Expand Up @@ -103,7 +118,7 @@ static int rtas_pci_read_config(struct pci_bus *bus,

/* Search only direct children of the bus */
for (dn = busdn->child; dn; dn = dn->sibling)
if (dn->devfn == devfn)
if (dn->devfn == devfn && of_device_available(dn))
return rtas_read_config(dn, where, size, val);
return PCIBIOS_DEVICE_NOT_FOUND;
}
Expand Down Expand Up @@ -146,7 +161,7 @@ static int rtas_pci_write_config(struct pci_bus *bus,

/* Search only direct children of the bus */
for (dn = busdn->child; dn; dn = dn->sibling)
if (dn->devfn == devfn)
if (dn->devfn == devfn && of_device_available(dn))
return rtas_write_config(dn, where, size, val);
return PCIBIOS_DEVICE_NOT_FOUND;
}
Expand Down

0 comments on commit 62b965d

Please sign in to comment.