]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ARM/PCI: Replace pci_sys_data->align_resource with global function pointer
authorGabriele Paoloni <gabriele.paoloni@huawei.com>
Fri, 30 Oct 2015 00:57:14 +0000 (19:57 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 2 Nov 2015 20:49:18 +0000 (14:49 -0600)
commitb3a72384fe29eec41a202b480145de225a148dbc
tree27241b40289aa2229afee1ea7bf8000d31c6ebaa
parent0021d22b73d69f2121b89987a94d5ef5c4e14271
ARM/PCI: Replace pci_sys_data->align_resource with global function pointer

dw_pcie_host_init() creates the PCI host bridge with pci_common_init_dev(),
an ARM-specific function that supplies the ARM-specific pci_sys_data
structure as the PCI "sysdata".  To use dw_pcie_host_init() on other
architectures, we will copy the internals of pci_common_init_dev() into
pcie-designware.c instead of calling it, and dw_pcie_host_init() will
supply the DesignWare pcie_port structure as "sysdata".

Most ARM "sysdata" users are specific to non-DesignWare host bridges;
they'll be unaffected because those bridges will continue to have the ARM
pci_sys_data.  Most of the rest are ARM-generic functions called by
pci_common_init_dev(); these will be unaffected because dw_pcie_host_init()
will no longer call pci_common_init().

But the ARM pcibios_align_resource() can be called by the PCI core for any
bridge, so it can't depend on sysdata since it may be either pci_sys_data
or pcie_port.

Remove the pcibios_align_resource() dependency on sysdata by replacing the
pci_sys_data->align_resource pointer with a global function pointer.

This is less general (we can no longer have per-host bridge
align_resource() methods), but the pci_sys_data->align_resource pointer was
used only by Marvell (see mvebu_pcie_enable()), so this would only be a
problem if we had a system with a combination of Marvell and other host
bridges

[bhelgaas: changelog]
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
arch/arm/include/asm/mach/pci.h
arch/arm/kernel/bios32.c