Commit eb98630b authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

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: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0f734484
...@@ -217,6 +217,10 @@ hil_keyb_init(void) ...@@ -217,6 +217,10 @@ hil_keyb_init(void)
return -ENOMEM; return -ENOMEM;
#if defined(CONFIG_HP300) #if defined(CONFIG_HP300)
if (!MACH_IS_HP300) {
err = -ENODEV;
goto err1;
}
if (!hwreg_present((void *)(HILBASE + HIL_DATA))) { if (!hwreg_present((void *)(HILBASE + HIL_DATA))) {
printk(KERN_ERR "HIL: hardware register was not found\n"); printk(KERN_ERR "HIL: hardware register was not found\n");
err = -ENODEV; err = -ENODEV;
......
...@@ -691,6 +691,11 @@ static int __init hp_sdc_rtc_init(void) ...@@ -691,6 +691,11 @@ static int __init hp_sdc_rtc_init(void)
{ {
int ret; int ret;
#ifdef __mc68000__
if (!MACH_IS_HP300)
return -ENODEV;
#endif
init_MUTEX(&i8042tregs); init_MUTEX(&i8042tregs);
if ((ret = hp_sdc_request_timer_irq(&hp_sdc_rtc_isr))) if ((ret = hp_sdc_request_timer_irq(&hp_sdc_rtc_isr)))
......
...@@ -306,6 +306,11 @@ static int __init hp_sdc_mlc_init(void) ...@@ -306,6 +306,11 @@ static int __init hp_sdc_mlc_init(void)
{ {
hil_mlc *mlc = &hp_sdc_mlc; hil_mlc *mlc = &hp_sdc_mlc;
#ifdef __mc68000__
if (!MACH_IS_HP300)
return -ENODEV;
#endif
printk(KERN_INFO PREFIX "Registering the System Domain Controller's HIL MLC.\n"); printk(KERN_INFO PREFIX "Registering the System Domain Controller's HIL MLC.\n");
hp_sdc_mlc_priv.emtestmode = 0; hp_sdc_mlc_priv.emtestmode = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment