Commit b14726c5 authored by Michael Ellerman's avatar Michael Ellerman Committed by Benjamin Herrenschmidt
Browse files

powerpc/powernv: Switch powernv drivers to use machine_xxx_initcall()



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: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 8d3c941e
......@@ -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);
......@@ -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 @@ static int __init opal_async_comp_init(void)
out:
return err;
}
subsys_initcall(opal_async_comp_init);
machine_subsys_initcall(powernv, opal_async_comp_init);
......@@ -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)
......
......@@ -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);
......@@ -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);
......@@ -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)
{
......
......@@ -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);
......@@ -123,4 +123,4 @@ static __init int rng_init(void)
return 0;
}
subsys_initcall(rng_init);
machine_subsys_initcall(powernv, rng_init);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment