Subject: systemsim: don't load systemsim_bd when running on real HW If we don't do this, we crash during bootup Signed-off-by: Arnd Bergmann --- Index: linux-2.6/drivers/block/systemsim_bd.c =================================================================== --- linux-2.6.orig/drivers/block/systemsim_bd.c +++ linux-2.6/drivers/block/systemsim_bd.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -208,6 +209,18 @@ static struct block_device_operations sy static spinlock_t systemsim_bd_lock = SPIN_LOCK_UNLOCKED; +static int mambo_detect(void) +{ + struct device_node *n; + + n = of_find_node_by_path("/mambo"); + if (n) { + of_node_put(n); + return 1; + } + return 0; +} + static int __init systemsim_bd_init(void) { struct device_node *systemsim; @@ -221,6 +234,9 @@ static int __init systemsim_bd_init(void return -1; } + if (!mambo_detect()) + return -ENODEV; + /* * We could detect which disks are configured in openfirmware * but I think this unnecessarily limits us from being able to