Skip to content

Commit

Permalink
PCI: xgene: Add register offset to config space base address
Browse files Browse the repository at this point in the history
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: 350f8be ("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>
  • Loading branch information
Feng Kan authored and Bjorn Helgaas committed Mar 6, 2015
1 parent 4efe874 commit 085a68d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/host/pci-xgene.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static bool xgene_pcie_hide_rc_bars(struct pci_bus *bus, int offset)
return false;
}

static int xgene_pcie_map_bus(struct pci_bus *bus, unsigned int devfn,
static void __iomem *xgene_pcie_map_bus(struct pci_bus *bus, unsigned int devfn,
int offset)
{
struct xgene_pcie_port *port = bus->sysdata;
Expand All @@ -137,7 +137,7 @@ static int xgene_pcie_map_bus(struct pci_bus *bus, unsigned int devfn,
return NULL;

xgene_pcie_set_rtdid_reg(bus, devfn);
return xgene_pcie_get_cfg_base(bus);
return xgene_pcie_get_cfg_base(bus) + offset;
}

static struct pci_ops xgene_pcie_ops = {
Expand Down

0 comments on commit 085a68d

Please sign in to comment.