Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138472
b: refs/heads/master
c: f817869
h: refs/heads/master
v: v3
  • Loading branch information
Tom Arbuckle authored and Benjamin Herrenschmidt committed Feb 22, 2009
1 parent 3c3e3b6 commit a74ade2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 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: 16c57b3620d77e0bc981da5ef32beae730512684
refs/heads/master: f81786913aa0ca27a3230f30d099e9613d0d7973
15 changes: 11 additions & 4 deletions trunk/arch/powerpc/kernel/pci_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,23 @@ scan_OF_pci_childs(struct device_node *parent, pci_OF_scan_iterator filter, void
static struct device_node *scan_OF_for_pci_dev(struct device_node *parent,
unsigned int devfn)
{
struct device_node *np;
struct device_node *np, *cnp;
const u32 *reg;
unsigned int psize;

for_each_child_of_node(parent, np) {
reg = of_get_property(np, "reg", &psize);
if (reg == NULL || psize < 4)
continue;
if (((reg[0] >> 8) & 0xff) == devfn)
if (reg && psize >= 4 && ((reg[0] >> 8) & 0xff) == devfn)
return np;

/* Note: some OFs create a parent node "multifunc-device" as
* a fake root for all functions of a multi-function device,
* we go down them as well. */
if (!strcmp(np->name, "multifunc-device")) {
cnp = scan_OF_for_pci_dev(np, devfn);
if (cnp)
return cnp;
}
}
return NULL;
}
Expand Down

0 comments on commit a74ade2

Please sign in to comment.