cuda/pmu: Make find_via_cuda/pmu init functions
authorNick Child <nick.child@ibm.com>
Thu, 16 Dec 2021 22:00:35 +0000 (17:00 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 23 Dec 2021 11:35:00 +0000 (22:35 +1100)
Make `find_via_cuda` and `find_via_pmu` initialization functions.
Previously, their definitions in `drivers/macintosh/via-cuda.h` include
the `__init` attribute but their alternative definitions in
`arch/powerpc/powermac/sectup./c` and prototypes in `include/linux/
cuda.h` and `include/linux/pmu.h` do not use the `__init` macro. Since,
only initialization functions call `find_via_cuda` and `find_via_pmu`
it is safe to label these functions with `__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-21-nick.child@ibm.com
arch/powerpc/platforms/powermac/setup.c
include/linux/cuda.h
include/linux/pmu.h

index f7661b81db1875c053455840aa12bc213d42e389..974d4b49867b5a91251bc2bedd747624f29e73fd 100644 (file)
@@ -166,7 +166,7 @@ static void pmac_show_cpuinfo(struct seq_file *m)
 }
 
 #ifndef CONFIG_ADB_CUDA
-int find_via_cuda(void)
+int __init find_via_cuda(void)
 {
        struct device_node *dn = of_find_node_by_name(NULL, "via-cuda");
 
@@ -180,7 +180,7 @@ int find_via_cuda(void)
 #endif
 
 #ifndef CONFIG_ADB_PMU
-int find_via_pmu(void)
+int __init find_via_pmu(void)
 {
        struct device_node *dn = of_find_node_by_name(NULL, "via-pmu");
 
index 45bfe9d61271ce6e918203d685ab88292d752d9d..daf3e6f984441bd0b7863f9ab451e77e1dabb88f 100644 (file)
@@ -12,7 +12,7 @@
 #include <uapi/linux/cuda.h>
 
 
-extern int find_via_cuda(void);
+extern int __init find_via_cuda(void);
 extern int cuda_request(struct adb_request *req,
                        void (*done)(struct adb_request *), int nbytes, ...);
 extern void cuda_poll(void);
index 52453a24a24f9b04c0c97335c0d38d0c75a43649..c677442d007ce485dc7c4e9c54d1a627de172bb4 100644 (file)
@@ -13,7 +13,7 @@
 #include <uapi/linux/pmu.h>
 
 
-extern int find_via_pmu(void);
+extern int __init find_via_pmu(void);
 
 extern int pmu_request(struct adb_request *req,
                void (*done)(struct adb_request *), int nbytes, ...);