diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2008-05-18 14:47:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-18 16:28:49 -0400 |
commit | eb98630ba02f6a23a2d202be082757a9e9940b2b (patch) | |
tree | d60e16ca2c77f33330d42251758c767d81d8e673 /drivers | |
parent | 0f734484ac51711f6b9e48b42242e19e88eb2926 (diff) |
m68k: Some input drivers do not check the platform
Some input drivers do not check whether they're actually running on the
correct platform, causing multi-platform kernels to crash if they are not.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/keyboard/hilkbd.c | 4 | ||||
-rw-r--r-- | drivers/input/misc/hp_sdc_rtc.c | 5 | ||||
-rw-r--r-- | drivers/input/serio/hp_sdc_mlc.c | 5 |
3 files changed, 14 insertions, 0 deletions
diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c index 50d80ecf0b80..aacf71f3cd44 100644 --- a/drivers/input/keyboard/hilkbd.c +++ b/drivers/input/keyboard/hilkbd.c | |||
@@ -217,6 +217,10 @@ hil_keyb_init(void) | |||
217 | return -ENOMEM; | 217 | return -ENOMEM; |
218 | 218 | ||
219 | #if defined(CONFIG_HP300) | 219 | #if defined(CONFIG_HP300) |
220 | if (!MACH_IS_HP300) { | ||
221 | err = -ENODEV; | ||
222 | goto err1; | ||
223 | } | ||
220 | if (!hwreg_present((void *)(HILBASE + HIL_DATA))) { | 224 | if (!hwreg_present((void *)(HILBASE + HIL_DATA))) { |
221 | printk(KERN_ERR "HIL: hardware register was not found\n"); | 225 | printk(KERN_ERR "HIL: hardware register was not found\n"); |
222 | err = -ENODEV; | 226 | err = -ENODEV; |
diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c index ab76ea442fa5..45e5d05b01de 100644 --- a/drivers/input/misc/hp_sdc_rtc.c +++ b/drivers/input/misc/hp_sdc_rtc.c | |||
@@ -691,6 +691,11 @@ static int __init hp_sdc_rtc_init(void) | |||
691 | { | 691 | { |
692 | int ret; | 692 | int ret; |
693 | 693 | ||
694 | #ifdef __mc68000__ | ||
695 | if (!MACH_IS_HP300) | ||
696 | return -ENODEV; | ||
697 | #endif | ||
698 | |||
694 | init_MUTEX(&i8042tregs); | 699 | init_MUTEX(&i8042tregs); |
695 | 700 | ||
696 | if ((ret = hp_sdc_request_timer_irq(&hp_sdc_rtc_isr))) | 701 | if ((ret = hp_sdc_request_timer_irq(&hp_sdc_rtc_isr))) |
diff --git a/drivers/input/serio/hp_sdc_mlc.c b/drivers/input/serio/hp_sdc_mlc.c index f1fd3b638a37..587398f5c9df 100644 --- a/drivers/input/serio/hp_sdc_mlc.c +++ b/drivers/input/serio/hp_sdc_mlc.c | |||
@@ -306,6 +306,11 @@ static int __init hp_sdc_mlc_init(void) | |||
306 | { | 306 | { |
307 | hil_mlc *mlc = &hp_sdc_mlc; | 307 | hil_mlc *mlc = &hp_sdc_mlc; |
308 | 308 | ||
309 | #ifdef __mc68000__ | ||
310 | if (!MACH_IS_HP300) | ||
311 | return -ENODEV; | ||
312 | #endif | ||
313 | |||
309 | printk(KERN_INFO PREFIX "Registering the System Domain Controller's HIL MLC.\n"); | 314 | printk(KERN_INFO PREFIX "Registering the System Domain Controller's HIL MLC.\n"); |
310 | 315 | ||
311 | hp_sdc_mlc_priv.emtestmode = 0; | 316 | hp_sdc_mlc_priv.emtestmode = 0; |