Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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



A lot of the code in platforms/pseries is using non-machine initcalls.
That means if a kernel built with pseries support runs on another
platform, for example powernv, the initcalls will still run.

Most of these cases are OK, though sometimes only due to luck. Some were
having more effect:

 * hcall_inst_init
  - Checking FW_FEATURE_LPAR which is set on ps3 & celleb.
 * mobility_sysfs_init
  - created sysfs files unconditionally
  - but no effect due to ENOSYS from rtas_ibm_suspend_me()
 * apo_pm_init
  - created sysfs, allows write
  - nothing checks the value written to though
 * alloc_dispatch_log_kmem_cache
  - creating kmem_cache on non-pseries machines

Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent b14726c5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include <asm/lppaca.h>
#include <asm/debug.h>
#include <asm/plpar_wrappers.h>
#include <asm/machdep.h>

struct dtl {
	struct dtl_entry	*buf;
@@ -391,4 +392,4 @@ err_remove_dir:
err:
	return rc;
}
arch_initcall(dtl_init);
machine_arch_initcall(pseries, dtl_init);
+2 −6
Original line number Diff line number Diff line
@@ -743,10 +743,7 @@ static struct eeh_ops pseries_eeh_ops = {
 */
static int __init eeh_pseries_init(void)
{
	int ret = -EINVAL;

	if (!machine_is(pseries))
		return ret;
	int ret;

	ret = eeh_ops_register(&pseries_eeh_ops);
	if (!ret)
@@ -757,5 +754,4 @@ static int __init eeh_pseries_init(void)

	return ret;
}

early_initcall(eeh_pseries_init);
machine_early_initcall(pseries, eeh_pseries_init);
+2 −1
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <asm/firmware.h>
#include <asm/cputable.h>
#include <asm/trace.h>
#include <asm/machdep.h>

DEFINE_PER_CPU(struct hcall_stats[HCALL_STAT_ARRAY_SIZE], hcall_stats);

@@ -162,4 +163,4 @@ static int __init hcall_inst_init(void)

	return 0;
}
__initcall(hcall_inst_init);
machine_device_initcall(pseries, hcall_inst_init);
+2 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/delay.h>
#include <linux/slab.h>

#include <asm/machdep.h>
#include <asm/rtas.h>
#include "pseries.h"

@@ -362,4 +363,4 @@ static int __init mobility_sysfs_init(void)

	return rc;
}
device_initcall(mobility_sysfs_init);
machine_device_initcall(pseries, mobility_sysfs_init);
+2 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#include <asm/rtas.h>
#include <asm/hw_irq.h>
#include <asm/ppc-pci.h>
#include <asm/machdep.h>

static int query_token, change_token;

@@ -532,5 +533,4 @@ static int rtas_msi_init(void)

	return 0;
}
arch_initcall(rtas_msi_init);
machine_arch_initcall(pseries, rtas_msi_init);
Loading