>From 71e949a668bc8c371dc21f17af01284719f1b383 Mon Sep 17 00:00:00 2001 From: Arend van Spriel Date: Wed, 11 Jan 2012 11:35:05 +0100 Subject: [PATCH] Revert "bcma: pci: use fixed windows when possible" This reverts commit 439678f8b0fca7aeca06c6581e3679eef618721a. --- drivers/bcma/host_pci.c | 32 +++++++++++--------------------- 1 files changed, 11 insertions(+), 21 deletions(-) diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c index 443b83a..990f5a8 100644 --- a/drivers/bcma/host_pci.c +++ b/drivers/bcma/host_pci.c @@ -21,58 +21,48 @@ static void bcma_host_pci_switch_core(struct bcma_device *core) pr_debug("Switched to core: 0x%X\n", core->id.id); } -/* Provides access to the requested core. Returns base offset that has to be - * used. It makes use of fixed windows when possible. */ -static u16 bcma_host_pci_provide_access_to_core(struct bcma_device *core) +static u8 bcma_host_pci_read8(struct bcma_device *core, u16 offset) { - switch (core->id.id) { - case BCMA_CORE_CHIPCOMMON: - return 3 * BCMA_CORE_SIZE; - case BCMA_CORE_PCIE: - return 2 * BCMA_CORE_SIZE; - } - if (core->bus->mapped_core != core) bcma_host_pci_switch_core(core); - return 0; -} - -static u8 bcma_host_pci_read8(struct bcma_device *core, u16 offset) -{ - offset += bcma_host_pci_provide_access_to_core(core); return ioread8(core->bus->mmio + offset); } static u16 bcma_host_pci_read16(struct bcma_device *core, u16 offset) { - offset += bcma_host_pci_provide_access_to_core(core); + if (core->bus->mapped_core != core) + bcma_host_pci_switch_core(core); return ioread16(core->bus->mmio + offset); } static u32 bcma_host_pci_read32(struct bcma_device *core, u16 offset) { - offset += bcma_host_pci_provide_access_to_core(core); + if (core->bus->mapped_core != core) + bcma_host_pci_switch_core(core); return ioread32(core->bus->mmio + offset); } static void bcma_host_pci_write8(struct bcma_device *core, u16 offset, u8 value) { - offset += bcma_host_pci_provide_access_to_core(core); + if (core->bus->mapped_core != core) + bcma_host_pci_switch_core(core); iowrite8(value, core->bus->mmio + offset); } static void bcma_host_pci_write16(struct bcma_device *core, u16 offset, u16 value) { - offset += bcma_host_pci_provide_access_to_core(core); + if (core->bus->mapped_core != core) + bcma_host_pci_switch_core(core); iowrite16(value, core->bus->mmio + offset); } static void bcma_host_pci_write32(struct bcma_device *core, u16 offset, u32 value) { - offset += bcma_host_pci_provide_access_to_core(core); + if (core->bus->mapped_core != core) + bcma_host_pci_switch_core(core); iowrite32(value, core->bus->mmio + offset); } -- 1.7.5.4