Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: xgene: Add register offset to config space base address

In xgene_pcie_map_bus(), we neglected to add in the register offset when
calculating the config space address. This means all config accesses
operated on the first four bytes of config space.

Add the register offset to the config space base address.

Also correct the xgene_pcie_map_bus() prototype to fix a compiler warning.

[bhelgaas: changelog]
Fixes: 350f8be5bb40 ("PCI: xgene: Convert to use generic config accessors")
Posting: http://lkml.kernel.org/r/1424214840-26498-1-git-send-email-fkan@apm.com
Signed-off-by: Feng Kan <fkan@apm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Tanmay Inamdar <tinamdar@apm.com>
Acked-by: Rob Herring <robh@kernel.org>

authored by

Feng Kan and committed by
Bjorn Helgaas
085a68d0 4efe874a

+2 -2
+2 -2
drivers/pci/host/pci-xgene.c
··· 127 127 return false; 128 128 } 129 129 130 - static int xgene_pcie_map_bus(struct pci_bus *bus, unsigned int devfn, 130 + static void __iomem *xgene_pcie_map_bus(struct pci_bus *bus, unsigned int devfn, 131 131 int offset) 132 132 { 133 133 struct xgene_pcie_port *port = bus->sysdata; ··· 137 137 return NULL; 138 138 139 139 xgene_pcie_set_rtdid_reg(bus, devfn); 140 - return xgene_pcie_get_cfg_base(bus); 140 + return xgene_pcie_get_cfg_base(bus) + offset; 141 141 } 142 142 143 143 static struct pci_ops xgene_pcie_ops = {