]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc/powernv: Switch powernv drivers to use machine_xxx_initcall()
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 15 Jul 2014 12:22:24 +0000 (22:22 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 28 Jul 2014 04:11:26 +0000 (14:11 +1000)
A lot of the code in platforms/powernv is using non-machine initcalls.
That means if a kernel built with powernv support runs on another
platform, for example pseries, the initcalls will still run.

That is usually OK, because the initcalls will check for something in
the device tree or elsewhere before doing anything, so on other
platforms they will usually just return.

But it's fishy for powernv code to be running on other platforms, so
switch them all to be machine initcalls. If we want any of them to run
on other platforms in future they should move to sysdev.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/powernv/eeh-powernv.c
arch/powerpc/platforms/powernv/opal-async.c
arch/powerpc/platforms/powernv/opal-lpc.c
arch/powerpc/platforms/powernv/opal-memory-errors.c
arch/powerpc/platforms/powernv/opal-xscom.c
arch/powerpc/platforms/powernv/opal.c
arch/powerpc/platforms/powernv/pci.c
arch/powerpc/platforms/powernv/rng.c

index 56a206f32f77e750dccb117691099ac0f850d6d1..998bcc18a491ad8f233414f1a4daf6768f4f509a 100644 (file)
@@ -398,9 +398,6 @@ static int __init eeh_powernv_init(void)
 {
        int ret = -EINVAL;
 
-       if (!machine_is(powernv))
-               return ret;
-
        ret = eeh_ops_register(&powernv_eeh_ops);
        if (!ret)
                pr_info("EEH: PowerNV platform initialized\n");
@@ -409,5 +406,4 @@ static int __init eeh_powernv_init(void)
 
        return ret;
 }
-
-early_initcall(eeh_powernv_init);
+machine_early_initcall(powernv, eeh_powernv_init);
index 32e2adfa532086bd107ee6c7dca5363ec78eec4f..e462ab947d16aa57ffcf1d55856cef0d46ee132b 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/wait.h>
 #include <linux/gfp.h>
 #include <linux/of.h>
+#include <asm/machdep.h>
 #include <asm/opal.h>
 
 #define N_ASYNC_COMPLETIONS    64
@@ -201,4 +202,4 @@ out_opal_node:
 out:
        return err;
 }
-subsys_initcall(opal_async_comp_init);
+machine_subsys_initcall(powernv, opal_async_comp_init);
index f04b4d8aca5a998edd95d39e63889a1c0ecf1587..ad4b31df779a389ceb83b1c62d77a850e9c1b749 100644 (file)
@@ -324,7 +324,7 @@ static int opal_lpc_init_debugfs(void)
        rc |= opal_lpc_debugfs_create_type(root, "fw", OPAL_LPC_FW);
        return rc;
 }
-device_initcall(opal_lpc_init_debugfs);
+machine_device_initcall(powernv, opal_lpc_init_debugfs);
 #endif  /* CONFIG_DEBUG_FS */
 
 void opal_lpc_init(void)
index b17a34b695ef86bc43fbbd3c145d66cb4b6ec493..43db2136dbff8f67101d085b8e5ecef7f75dacdb 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/mm.h>
 #include <linux/slab.h>
 
+#include <asm/machdep.h>
 #include <asm/opal.h>
 #include <asm/cputable.h>
 
@@ -143,4 +144,4 @@ static int __init opal_mem_err_init(void)
        }
        return 0;
 }
-subsys_initcall(opal_mem_err_init);
+machine_subsys_initcall(powernv, opal_mem_err_init);
index 4cd2ea6c0dbe13ecf2fb7926838cfeac9277730c..7634d1c62299b44063169989ef32a27c9ae5ce9d 100644 (file)
@@ -130,4 +130,4 @@ static int opal_xscom_init(void)
                scom_init(&opal_scom_controller);
        return 0;
 }
-arch_initcall(opal_xscom_init);
+machine_arch_initcall(powernv, opal_xscom_init);
index 199975613fe99fbbc030e34c205283dbb889f2c8..6ef2e5c5bc6440d787d7a42d50606f57555913a9 100644 (file)
@@ -22,6 +22,8 @@
 #include <linux/kobject.h>
 #include <linux/delay.h>
 #include <linux/memblock.h>
+
+#include <asm/machdep.h>
 #include <asm/opal.h>
 #include <asm/firmware.h>
 #include <asm/mce.h>
@@ -200,8 +202,7 @@ static int __init opal_register_exception_handlers(void)
 
        return 0;
 }
-
-early_initcall(opal_register_exception_handlers);
+machine_early_initcall(powernv, opal_register_exception_handlers);
 
 int opal_notifier_register(struct notifier_block *nb)
 {
@@ -368,7 +369,7 @@ static int __init opal_message_init(void)
        }
        return 0;
 }
-early_initcall(opal_message_init);
+machine_early_initcall(powernv, opal_message_init);
 
 int opal_get_chars(uint32_t vtermno, char *buf, int count)
 {
@@ -630,7 +631,7 @@ static int __init opal_init(void)
 
        return 0;
 }
-subsys_initcall(opal_init);
+machine_subsys_initcall(powernv, opal_init);
 
 void opal_shutdown(void)
 {
index 4dff552aa4e4fb0412d32107c4cbc693d46f41ab..c584961b99cc6720a6c48c21bf5706a6607ae522 100644 (file)
@@ -843,5 +843,4 @@ static int __init tce_iommu_bus_notifier_init(void)
        bus_register_notifier(&pci_bus_type, &tce_iommu_bus_nb);
        return 0;
 }
-
-subsys_initcall_sync(tce_iommu_bus_notifier_init);
+machine_subsys_initcall_sync(powernv, tce_iommu_bus_notifier_init);
index 1cb160dc1609a5be5dbfd17ff0bfcbeaf362829b..80db43944afefe927cec6e09ed088bffb635f45d 100644 (file)
@@ -123,4 +123,4 @@ static __init int rng_init(void)
 
        return 0;
 }
-subsys_initcall(rng_init);
+machine_subsys_initcall(powernv, rng_init);