ARM: PCI: expand single-line pci_common_init() wrapper function
Subsystems (4)
PATCH 1/1 ARM: PCI: expand single-line pci_common_init() wrapper function
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 updating all uses of pci_common_init() to instead call pci_common_init_dev() with a NULL first argument and removing pci_common_init().
--- arch/arm/include/asm/mach/pci.h | 9 --------- arch/arm/mach-dove/pcie.c | 2 +- arch/arm/mach-footbridge/ebsa285-pci.c | 2 +- arch/arm/mach-footbridge/netwinder-pci.c | 2 +- arch/arm/mach-mv78xx0/pcie.c | 2 +- arch/arm/mach-orion5x/board-mss2.c | 2 +- arch/arm/mach-orion5x/board-rd88f5182.c | 2 +- arch/arm/mach-orion5x/dns323-setup.c | 2 +- arch/arm/mach-orion5x/kurobox_pro-setup.c | 2 +- arch/arm/mach-orion5x/terastation_pro2-setup.c | 2 +- arch/arm/mach-orion5x/ts209-setup.c | 2 +- arch/arm/mach-orion5x/ts409-setup.c | 2 +- 12 files changed, 11 insertions(+), 20 deletions(-)
arch/arm/include/asm/mach/pci.h +0 -9
@@ -52,15 +52,6 @@ struct pci_sys_data {*/ 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); -} -/* * Setup early fixed I/O mapping. */
arch/arm/mach-dove/pcie.c +1 -1
@@ -222,5 +222,5 @@ void __init dove_pcie_init(int init_port0, int init_port1)if (init_port1)add_pcie_port (1 ,DOVE_PCIE1_VIRT_BASE ); -pci_common_init (&dove_pci); +pci_common_init_dev (NULL , &dove_pci); }
arch/arm/mach-footbridge/ebsa285-pci.c +1 -1
@@ -41,7 +41,7 @@ static struct hw_pci ebsa285_pci __initdata = {static int __init ebsa285_init_pci (void ) {if (machine_is_ebsa285 ()) -pci_common_init (&ebsa285_pci); +pci_common_init_dev (NULL , &ebsa285_pci);return 0 ; }
arch/arm/mach-footbridge/netwinder-pci.c +1 -1
@@ -55,7 +55,7 @@ static struct hw_pci netwinder_pci __initdata = {static int __init netwinder_pci_init (void ) {if (machine_is_netwinder ()) -pci_common_init (&netwinder_pci); +pci_common_init_dev (NULL , &netwinder_pci);return 0 ; }
arch/arm/mach-mv78xx0/pcie.c +1 -1
@@ -276,5 +276,5 @@ void __init mv78xx0_pcie_init(int init_port0, int init_port1) } } -pci_common_init (&mv78xx0_pci); +pci_common_init_dev (NULL , &mv78xx0_pci); }
arch/arm/mach-orion5x/board-mss2.c +1 -1
@@ -48,7 +48,7 @@ static struct hw_pci mss2_pci __initdata = {static int __init mss2_pci_init (void ) {if (machine_is_mss2 ()) -pci_common_init (&mss2_pci); +pci_common_init_dev (NULL , &mss2_pci);return 0 ; }
arch/arm/mach-orion5x/board-rd88f5182.c +1 -1
@@ -106,7 +106,7 @@ static struct hw_pci rd88f5182_pci __initdata = {static int __init rd88f5182_pci_init (void ) {if (of_machine_is_compatible ("marvell,rd-88f5182-nas" )) -pci_common_init (&rd88f5182_pci); +pci_common_init_dev (NULL , &rd88f5182_pci);return 0 ; }
arch/arm/mach-orion5x/dns323-setup.c +1 -1
@@ -99,7 +99,7 @@ static int __init dns323_pci_init(void)* gets in the way of initialising the SATA controller. */ if (machine_is_dns323 () && system_rev ==DNS323_REV_A1 ) -pci_common_init (&dns323_pci); +pci_common_init_dev (NULL , &dns323_pci);return 0 ; }
arch/arm/mach-orion5x/kurobox_pro-setup.c +1 -1
@@ -144,7 +144,7 @@ static int __init kurobox_pro_pci_init(void) {if (machine_is_kurobox_pro ()) {orion5x_pci_disable (); -pci_common_init (&kurobox_pro_pci); +pci_common_init_dev (NULL , &kurobox_pro_pci); }return 0 ;
arch/arm/mach-orion5x/terastation_pro2-setup.c +1 -1
@@ -126,7 +126,7 @@ static struct hw_pci tsp2_pci __initdata = {static int __init tsp2_pci_init (void ) {if (machine_is_terastation_pro2 ()) -pci_common_init (&tsp2_pci); +pci_common_init_dev (NULL , &tsp2_pci);return 0 ; }
arch/arm/mach-orion5x/ts209-setup.c +1 -1
@@ -174,7 +174,7 @@ static struct hw_pci qnap_ts209_pci __initdata = {static int __init qnap_ts209_pci_init (void ) {if (machine_is_ts209 ()) -pci_common_init (&qnap_ts209_pci); +pci_common_init_dev (NULL , &qnap_ts209_pci);return 0 ; }
arch/arm/mach-orion5x/ts409-setup.c +1 -1
@@ -145,7 +145,7 @@ static struct hw_pci qnap_ts409_pci __initdata = {static int __init qnap_ts409_pci_init (void ) {if (machine_is_ts409 ()) -pci_common_init (&qnap_ts409_pci); +pci_common_init_dev (NULL , &qnap_ts409_pci);return 0 ; }
Signature · 1 line
2.43.0
Andrew Lunn
maintainerQuoted 8 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 updating all uses ofpci_common_init()to instead callpci_common_init_dev()with a NULL first argument and removingpci_common_init().
Nobody seems to call pci_common_init_dev() without passing NULL. So i think it makes more sense to rename pci_common_init_dev() to pci_common_init() and drop struct device *parent parameter. You then only need to change pci.h and bios32.c.
Andrew
Hi, Andrew,
Quoted 4 lines · Andrew Lunn
Nobody seems to call
pci_common_init_dev()without passing NULL. So i think it makes more sense to renamepci_common_init_dev()topci_common_init()and drop struct device *parent parameter. You then only need to changepci.handbios32.c.
I considered that, but decided against it because it would prevent the code from easily being updated to pass a parent parameter in the future. However, given the age of the affected platforms, that is unlikely to happen, so your approach might make more sense. What do you think?
Ethan
Andrew Lunn
maintainerQuoted 8 lines · Ethan Nelson-Moore
Hi, Andrew,
Quoted 4 lines · Andrew Lunn
Nobody seems to call
pci_common_init_dev()without passing NULL. So i think it makes more sense to renamepci_common_init_dev()topci_common_init()and drop struct device *parent parameter. You then only need to changepci.handbios32.c.
Quoted 5 lines
I considered that, but decided against it because it would prevent the code from easily being updated to pass a parent parameter in the future. However, given the age of the affected platforms, that is unlikely to happen, so your approach might make more sense. What do you think?
These are all old platforms, they are likely to be slowly removed over the next few years, and then pci_common_init* can be removed. I don't expect any code to need to set the parent. And some new board does come along which needs it, it is an easy revert.
You could also include a tiny patch which removes parent from pcibios_init_hw().
Andrew