From 0fdba6946d7f885f32b6bc5950e8baf526a2d839 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 24 May 2001 19:01:44 +0000 Subject: Polish a bit; no functional changes. --- arch/mips64/sgi-ip27/ip27-pci.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/arch/mips64/sgi-ip27/ip27-pci.c b/arch/mips64/sgi-ip27/ip27-pci.c index ef0a3e083..88150be4b 100644 --- a/arch/mips64/sgi-ip27/ip27-pci.c +++ b/arch/mips64/sgi-ip27/ip27-pci.c @@ -55,9 +55,6 @@ do { \ bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id], \ bus_to_wid[bus_id]); \ \ - /*if (dev->bus->number) */ \ - /* return PCIBIOS_DEVICE_NOT_FOUND; */ \ - \ if (dev->vendor == PCI_VENDOR_ID_SGI \ && dev->device == PCI_DEVICE_ID_SGI_IOC3 \ && ((where >= 0x14 && where < 0x40) || (where >= 0x48))) { \ @@ -103,9 +100,6 @@ do { \ bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id], \ bus_to_wid[bus_id]); \ \ - /* if (dev->bus->number) */ \ - /* return PCIBIOS_DEVICE_NOT_FOUND; */ \ - \ if (dev->vendor == PCI_VENDOR_ID_SGI \ && dev->device == PCI_DEVICE_ID_SGI_IOC3 \ && ((where >= 0x14 && where < 0x40) || (where >= 0x48))) \ @@ -270,19 +264,23 @@ pcibios_setup(char *str) return str; } +/* + * Device might live on a subordinate PCI bus. XXX Walk up the chain of buses + * to find the slot number in sense of the bridge device register. + * XXX This also means multiple devices might rely on conflicting bridge + * settings. + */ + static void __init pci_disable_swapping(struct pci_dev *dev) { unsigned int bus_id = (unsigned) dev->bus->number; bridge_t *bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id], - bus_to_wid[bus_id]); + bus_to_wid[bus_id]); int slot = PCI_SLOT(dev->devfn); - bridgereg_t devreg; - - devreg = bridge->b_device[slot].reg; - devreg &= ~BRIDGE_DEV_SWAP_DIR; /* turn off byte swapping */ - bridge->b_device[slot].reg = devreg; + /* Turn off byte swapping */ + bridge->b_device[slot].reg; devreg &= ~BRIDGE_DEV_SWAP_DIR; bridge->b_widget.w_tflush; /* Flush */ } @@ -291,14 +289,11 @@ pci_enable_swapping(struct pci_dev *dev) { unsigned int bus_id = (unsigned) dev->bus->number; bridge_t *bridge = (bridge_t *) NODE_SWIN_BASE(bus_to_nid[bus_id], - bus_to_wid[bus_id]); + bus_to_wid[bus_id]); int slot = PCI_SLOT(dev->devfn); - bridgereg_t devreg; - - devreg = bridge->b_device[slot].reg; - devreg |= BRIDGE_DEV_SWAP_DIR; /* turn on byte swapping */ - bridge->b_device[slot].reg = devreg; + /* Turn on byte swapping */ + bridge->b_device[slot].reg; devreg |= BRIDGE_DEV_SWAP_DIR; bridge->b_widget.w_tflush; /* Flush */ } -- cgit v1.2.3