summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/pci_of_scan.c
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2013-10-17 23:19:43 +1100
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-10-30 16:01:04 +1100
commit3e7cec6b17d1c915cf4de1a3853f1b4ae0ed26b0 (patch)
treeb6cfb687acebe13074bb62140e0001b248c73611 /arch/powerpc/kernel/pci_of_scan.c
parent411cabf79e684171669ad29a0628c400b4431e95 (diff)
powerpc: Fix little endian issue in OF PCI scan
This issue was causing the QEMU emulated USB device to fail dring PCI probe. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/pci_of_scan.c')
-rw-r--r--arch/powerpc/kernel/pci_of_scan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/pci_of_scan.c b/arch/powerpc/kernel/pci_of_scan.c
index 4368ec6fdc8c..ac0b034f9ae0 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -302,7 +302,7 @@ static struct pci_dev *of_scan_pci_dev(struct pci_bus *bus,
struct device_node *dn)
{
struct pci_dev *dev = NULL;
- const u32 *reg;
+ const __be32 *reg;
int reglen, devfn;
pr_debug(" * %s\n", dn->full_name);
@@ -312,7 +312,7 @@ static struct pci_dev *of_scan_pci_dev(struct pci_bus *bus,
reg = of_get_property(dn, "reg", &reglen);
if (reg == NULL || reglen < 20)
return NULL;
- devfn = (reg[0] >> 8) & 0xff;
+ devfn = (of_read_number(reg, 1) >> 8) & 0xff;
/* Check if the PCI device is already there */
dev = pci_get_slot(bus, devfn);