Commit 9785d646 authored by Grant Grundler's avatar Grant Grundler Committed by Kyle McMartin

parisc: fix wrong assumption about bus->self

Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> posted a patch series
to linux-pci to fix a wrong assumption about pci_bus->self==NULL for
all PCI host bus controllers. While PARISC platforms to not behave
this way, I prefer to have the code consistent across architectures.
The following patch replaces pci_bus->self with pci_bus->parent when
used as a test to check for "root bus controller".
Signed-off-by: default avatarGrant Grundler <grundler@parisc-linux.org>
Signed-off-by: default avatarKyle McMartin <kyle@mcmartin.ca>
parent c1da90fd
...@@ -587,7 +587,7 @@ dino_fixup_bus(struct pci_bus *bus) ...@@ -587,7 +587,7 @@ dino_fixup_bus(struct pci_bus *bus)
bus->resource[i+1] = &res[i]; bus->resource[i+1] = &res[i];
} }
} else if(bus->self) { } else if (bus->parent) {
int i; int i;
pci_read_bridge_bases(bus); pci_read_bridge_bases(bus);
......
...@@ -487,7 +487,7 @@ iosapic_xlate_pin(struct iosapic_info *isi, struct pci_dev *pcidev) ...@@ -487,7 +487,7 @@ iosapic_xlate_pin(struct iosapic_info *isi, struct pci_dev *pcidev)
} }
/* Check if pcidev behind a PPB */ /* Check if pcidev behind a PPB */
if (NULL != pcidev->bus->self) { if (pcidev->bus->parent) {
/* Convert pcidev INTR_PIN into something we /* Convert pcidev INTR_PIN into something we
** can lookup in the IRT. ** can lookup in the IRT.
*/ */
...@@ -523,10 +523,9 @@ iosapic_xlate_pin(struct iosapic_info *isi, struct pci_dev *pcidev) ...@@ -523,10 +523,9 @@ iosapic_xlate_pin(struct iosapic_info *isi, struct pci_dev *pcidev)
#endif /* PCI_BRIDGE_FUNCS */ #endif /* PCI_BRIDGE_FUNCS */
/* /*
** Locate the host slot the PPB nearest the Host bus * Locate the host slot of the PPB.
** adapter. */
*/ while (p->parent->parent)
while (NULL != p->parent->self)
p = p->parent; p = p->parent;
intr_slot = PCI_SLOT(p->self->devfn); intr_slot = PCI_SLOT(p->self->devfn);
......
...@@ -644,7 +644,7 @@ lba_fixup_bus(struct pci_bus *bus) ...@@ -644,7 +644,7 @@ lba_fixup_bus(struct pci_bus *bus)
** Properly Setup MMIO resources for this bus. ** Properly Setup MMIO resources for this bus.
** pci_alloc_primary_bus() mangles this. ** pci_alloc_primary_bus() mangles this.
*/ */
if (bus->self) { if (bus->parent) {
int i; int i;
/* PCI-PCI Bridge */ /* PCI-PCI Bridge */
pci_read_bridge_bases(bus); pci_read_bridge_bases(bus);
...@@ -802,7 +802,7 @@ lba_fixup_bus(struct pci_bus *bus) ...@@ -802,7 +802,7 @@ lba_fixup_bus(struct pci_bus *bus)
** Can't fixup here anyway....garr... ** Can't fixup here anyway....garr...
*/ */
if (fbb_enable) { if (fbb_enable) {
if (bus->self) { if (bus->parent) {
u8 control; u8 control;
/* enable on PPB */ /* enable on PPB */
(void) pci_read_config_byte(bus->self, PCI_BRIDGE_CONTROL, &control); (void) pci_read_config_byte(bus->self, PCI_BRIDGE_CONTROL, &control);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment