summaryrefslogtreecommitdiffstats
path: root/drivers/pci/host/pci-exynos.c
diff options
context:
space:
mode:
authorGabriele Paoloni2015-10-08 21:27:48 +0200
committerBjorn Helgaas2015-11-02 21:48:45 +0100
commit4c45852f494dab827291c656ee9e12f3f4ee64d6 (patch)
tree9cd03214cccebdd4cfcb72411d26b2d8b1c99245 /drivers/pci/host/pci-exynos.c
parentPCI: designware: Use exact access size in dw_pcie_cfg_read() (diff)
downloadkernel-qcow2-linux-4c45852f494dab827291c656ee9e12f3f4ee64d6.tar.gz
kernel-qcow2-linux-4c45852f494dab827291c656ee9e12f3f4ee64d6.tar.xz
kernel-qcow2-linux-4c45852f494dab827291c656ee9e12f3f4ee64d6.zip
PCI: designware: Simplify dw_pcie_cfg_read/write() interfaces
Callers of dw_pcie_cfg_read() and dw_pcie_cfg_write() previously had to split the address into "addr" and "where". The callees assumed "addr" was 32-bit aligned (with zeros in the low two bits) and they used only the low two bits of "where". Accept the entire address in "addr" and drop the now-redundant "where" argument. As an example, this replaces this: int dw_pcie_cfg_read(void __iomem *addr, int where, int size, u32 *val) *val = readb(addr + (where & 1)); with this: int dw_pcie_cfg_read(void __iomem *addr, int size, u32 *val) *val = readb(addr): [bhelgaas: changelog, split access size change to separate patch] Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/host/pci-exynos.c')
-rw-r--r--drivers/pci/host/pci-exynos.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/pci/host/pci-exynos.c b/drivers/pci/host/pci-exynos.c
index f9f468d9a819..01095e1160a4 100644
--- a/drivers/pci/host/pci-exynos.c
+++ b/drivers/pci/host/pci-exynos.c
@@ -454,7 +454,7 @@ static int exynos_pcie_rd_own_conf(struct pcie_port *pp, int where, int size,
int ret;
exynos_pcie_sideband_dbi_r_mode(pp, true);
- ret = dw_pcie_cfg_read(pp->dbi_base + (where & ~0x3), where, size, val);
+ ret = dw_pcie_cfg_read(pp->dbi_base + where, size, val);
exynos_pcie_sideband_dbi_r_mode(pp, false);
return ret;
}
@@ -465,8 +465,7 @@ static int exynos_pcie_wr_own_conf(struct pcie_port *pp, int where, int size,
int ret;
exynos_pcie_sideband_dbi_w_mode(pp, true);
- ret = dw_pcie_cfg_write(pp->dbi_base + (where & ~0x3),
- where, size, val);
+ ret = dw_pcie_cfg_write(pp->dbi_base + where, size, val);
exynos_pcie_sideband_dbi_w_mode(pp, false);
return ret;
}