From 336c3c2ec7e24bdf01c8f0c311ac7081b1f73d72 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Sat, 17 Feb 2007 09:10:44 -0600 Subject: [POWERPC] 83xx: Cleaning up machine probing and board initcalls Cleaned up the probing functionality to be more consistent across all 83xx boards and added machine_is() protection around board initcalls to ensure they only do something if we are actually running on that board. Additionally, removed some dead code on mpc832x_mds. Signed-off-by: Kumar Gala --- arch/powerpc/platforms/83xx/mpc834x_mds.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'arch/powerpc/platforms/83xx/mpc834x_mds.c') diff --git a/arch/powerpc/platforms/83xx/mpc834x_mds.c b/arch/powerpc/platforms/83xx/mpc834x_mds.c index d2736da76c4..9fd9adf8ff9 100644 --- a/arch/powerpc/platforms/83xx/mpc834x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c @@ -176,6 +176,9 @@ static int __init mpc834x_rtc_hookup(void) { struct timespec tv; + if (!machine_is(mpc834x_mds)) + return 0; + ppc_md.get_rtc_time = ds1374_get_rtc_time; ppc_md.set_rtc_time = ds1374_set_rtc_time; @@ -194,10 +197,9 @@ late_initcall(mpc834x_rtc_hookup); */ static int __init mpc834x_mds_probe(void) { - /* We always match for now, eventually we should look at the flat - dev tree to ensure this is the board we are suppose to run on - */ - return 1; + unsigned long root = of_get_flat_dt_root(); + + return of_flat_dt_is_compatible(root, "MPC834xMDS"); } define_machine(mpc834x_mds) { -- cgit v1.2.3