powerpc/83xx: Add __init attribute to eligible functions
authorNick Child <nick.child@ibm.com>
Thu, 16 Dec 2021 22:00:32 +0000 (17:00 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 23 Dec 2021 11:33:18 +0000 (22:33 +1100)
Some functions defined in 'arch/powerpc/platforms/83xx' are deserving of an
`__init` macro attribute. These functions are only called by other
initialization functions and therefore should inherit the attribute.
Also, change function declarations in header files to include `__init`.

Signed-off-by: Nick Child <nick.child@ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211216220035.605465-18-nick.child@ibm.com
arch/powerpc/platforms/83xx/km83xx.c
arch/powerpc/platforms/83xx/mpc834x_mds.c
arch/powerpc/platforms/83xx/mpc837x_mds.c
arch/powerpc/platforms/83xx/mpc837x_rdb.c
arch/powerpc/platforms/83xx/mpc83xx.h
arch/powerpc/platforms/83xx/usb.c

index 108e1e4d2683efdb418edb24c5c2272634fe56eb..d9eed0decb28f225436bdda091bee8b250db0549 100644 (file)
@@ -39,7 +39,7 @@
 
 #define SVR_REV(svr)    (((svr) >>  0) & 0xFFFF) /* Revision field */
 
-static void quirk_mpc8360e_qe_enet10(void)
+static void __init quirk_mpc8360e_qe_enet10(void)
 {
        /*
         * handle mpc8360E Erratum QE_ENET10:
index 6d91bdce0a18d871baadf7cf72189c884685ed0f..0713deffb40cdfd48816de1e374152bac0471b10 100644 (file)
@@ -35,7 +35,7 @@
 #include "mpc83xx.h"
 
 #define BCSR5_INT_USB          0x02
-static int mpc834xemds_usb_cfg(void)
+static int __init mpc834xemds_usb_cfg(void)
 {
        struct device_node *np;
        void __iomem *bcsr_regs = NULL;
index f28d166ea7db869b939bb49bb4673fa0fffba119..fc88ab97f6e3d1988b8aca9c7c3a2a71c1375a2c 100644 (file)
@@ -23,7 +23,7 @@
 #define BCSR12_USB_SER_PIN     0x80
 #define BCSR12_USB_SER_DEVICE  0x02
 
-static int mpc837xmds_usb_cfg(void)
+static int __init mpc837xmds_usb_cfg(void)
 {
        struct device_node *np;
        const void *phy_type, *mode;
index 7fb7684c256b031334e9240bbfa0fb574703e2e9..5d48c6842098e3f5e02f3804a42fe8b476e767e1 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "mpc83xx.h"
 
-static void mpc837x_rdb_sd_cfg(void)
+static void __init mpc837x_rdb_sd_cfg(void)
 {
        void __iomem *im;
 
index a30d30588cf6979c086a7f542d91b8f2f31ffbb6..aea803ba3a15209ee5f783c8d612dcbb8dd7e732 100644 (file)
@@ -68,9 +68,9 @@
 
 extern void __noreturn mpc83xx_restart(char *cmd);
 extern long mpc83xx_time_init(void);
-extern int mpc837x_usb_cfg(void);
-extern int mpc834x_usb_cfg(void);
-extern int mpc831x_usb_cfg(void);
+int __init mpc837x_usb_cfg(void);
+int __init mpc834x_usb_cfg(void);
+int __init mpc831x_usb_cfg(void);
 extern void mpc83xx_ipic_init_IRQ(void);
 
 #ifdef CONFIG_PCI
index 3d247d726ed5e398d44d28d025f743efe98eb059..b0bda20aaccf82d0b6e56b361c8751ffb55a159e 100644 (file)
@@ -20,7 +20,7 @@
 
 
 #ifdef CONFIG_PPC_MPC834x
-int mpc834x_usb_cfg(void)
+int __init mpc834x_usb_cfg(void)
 {
        unsigned long sccr, sicrl, sicrh;
        void __iomem *immap;
@@ -96,7 +96,7 @@ int mpc834x_usb_cfg(void)
 #endif /* CONFIG_PPC_MPC834x */
 
 #ifdef CONFIG_PPC_MPC831x
-int mpc831x_usb_cfg(void)
+int __init mpc831x_usb_cfg(void)
 {
        u32 temp;
        void __iomem *immap, *usb_regs;
@@ -209,7 +209,7 @@ out:
 #endif /* CONFIG_PPC_MPC831x */
 
 #ifdef CONFIG_PPC_MPC837x
-int mpc837x_usb_cfg(void)
+int __init mpc837x_usb_cfg(void)
 {
        void __iomem *immap;
        struct device_node *np = NULL;