[ARM] pxa/csb701: do not register devices on non-csb726 boads
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Tue, 31 Mar 2009 23:40:05 +0000 (03:40 +0400)
committerEric Miao <eric.miao@marvell.com>
Sat, 4 Apr 2009 02:26:35 +0000 (10:26 +0800)
csb701 driver can currently only be used on csb726 boards,
limit the csb701 devices registration to csb726 board.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
arch/arm/mach-pxa/csb701.c

index 4a2a2952c3748e0c50f7147a1a247ef5cf4790a0..5a221a49ea4de38bb37df529e0271baa9355ca31 100644 (file)
@@ -5,6 +5,8 @@
 #include <linux/input.h>
 #include <linux/leds.h>
 
+#include <asm/mach-types.h>
+
 static struct gpio_keys_button csb701_buttons[] = {
        {
                .code   = 0x7,
@@ -54,6 +56,9 @@ static struct platform_device *devices[] __initdata = {
 
 static int __init csb701_init(void)
 {
+       if (!machine_is_csb726())
+               return -ENODEV;
+
        return platform_add_devices(devices, ARRAY_SIZE(devices));
 }