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: linus-2.6/drivers/block/systemsim_bd.c =================================================================== --- linus-2.6.orig/drivers/block/systemsim_bd.c +++ linus-2.6/drivers/block/systemsim_bd.c @@ -45,6 +45,7 @@ #include #include +#include #include @@ -210,11 +211,26 @@ static struct block_device_operations mb static spinlock_t mbd_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 mbd_init(void) { int err = -ENOMEM; int i; + if (!mambo_detect()) + return -ENODEV; + for (i = 0; i < MAX_MBD; i++) { struct gendisk *disk = alloc_disk(1); if (!disk)