ARM: PCI: merge pci_common_init_dev() into pci_common_init()
PATCH v2 1/1 ARM: PCI: merge pci_common_init_dev() into pci_common_init()
pci_common_init() is a compatibility wrapper that simply calls pci_common_init_dev() with an additional NULL argument. The comment above it implies that it should be replaced by pci_common_init_dev(), but that has never happened - there are no callers of pci_common_init_dev() in the kernel. Make the PCI code more straightforward by getting rid of the wrapper function and instead removing the device argument from pci_common_init_dev() and renaming it to pci_common_init().
---
Changes in v2: Instead of removing pci_common_init() and converting all callers to use pci_common_init_dev(), simply remove pci_common_init_dev() and the unused parent parameter in pcibios_init_hw(). Suggested by Andrew Lunn.
arch/arm/include/asm/mach/pci.h | 11 +---------- arch/arm/kernel/bios32.c | 8 +++----- 2 files changed, 4 insertions(+), 15 deletions(-)
arch/arm/include/asm/mach/pci.h +1 -10
@@ -50,16 +50,7 @@ struct pci_sys_data {/* * Call this with your hw_pci struct to initialise the PCI system. */ -void pci_common_init_dev (struct device *,struct hw_pci *); - -/* -* Compatibility wrapper for older platforms that do not care about -* passing the parent device. -*/ -static inline void pci_common_init (struct hw_pci *hw) -{ -pci_common_init_dev (NULL , hw); -} +void pci_common_init (struct hw_pci *hw);/* * Setup early fixed I/O mapping.
arch/arm/kernel/bios32.c +3 -5
@@ -424,8 +424,7 @@ static int pcibios_init_resource(int busnr, struct pci_sys_data *sys)return 0 ; } -static void pcibios_init_hw (struct device *parent,struct hw_pci *hw, -struct list_head *head) +static void pcibios_init_hw (struct hw_pci *hw,struct list_head *head) {struct pci_sys_data *sys =NULL ;int ret;
@@ -466,7 +465,6 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,else {list_splice_init (&sys->resources, &bridge->windows); - bridge->dev.parent = parent; bridge->sysdata = sys; bridge->busnr = sys->busnr; bridge->ops = hw->ops;
@@ -492,7 +490,7 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw, } } -void pci_common_init_dev (struct device *parent,struct hw_pci *hw) +void pci_common_init (struct hw_pci *hw) {struct pci_sys_data *sys;LIST_HEAD (head);
@@ -500,7 +498,7 @@ void pci_common_init_dev(struct device *parent, struct hw_pci *hw)pci_add_flags (PCI_REASSIGN_ALL_BUS );if (hw->preinit) hw->preinit (); -pcibios_init_hw (parent, hw, &head); +pcibios_init_hw (hw, &head);if (hw->postinit) hw->postinit ();
Signature · 1 line
2.43.0
Quoted 10 lines · Ethan Nelson-Moore
pci_common_init()is a compatibility wrapper that simply callspci_common_init_dev()with an additional NULL argument. The comment above it implies that it should be replaced bypci_common_init_dev(), but that has never happened - there are no callers ofpci_common_init_dev()in the kernel. Make the PCI code more straightforward by getting rid of the wrapper function and instead removing the device argument frompci_common_init_dev()and renaming it topci_common_init().Signed-off-by Ethan Nelson-Moore <[email protected]>
Andrew