浏览代码

m68k: macide doesnt check for Mac

The Macintosh IDE driver (macide) doesn't check whether it's actually running
on Mac hardware, causing a crash if it isn't.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Geert Uytterhoeven 17 年之前
父节点
当前提交
3ce92a2a7b
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      drivers/ide/legacy/macide.c

+ 3 - 0
drivers/ide/legacy/macide.c

@@ -95,6 +95,9 @@ static int __init macide_init(void)
 	int irq;
 	int irq;
 	hw_regs_t hw;
 	hw_regs_t hw;
 
 
+	if (!MACH_IS_MAC)
+		return -ENODEV;
+
 	switch (macintosh_config->ide_type) {
 	switch (macintosh_config->ide_type) {
 	case MAC_IDE_QUADRA:
 	case MAC_IDE_QUADRA:
 		base = IDE_BASE;
 		base = IDE_BASE;