summaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorOlaf Hering <olaf@aepfle.de>2006-09-01 06:27:41 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-01 20:39:08 +0200
commitef16b5194f3233a11851180cd82eafb76542047d (patch)
tree2c9cf994951b5d539f5dce21aaf93f83c0ba17d3 /drivers/block
parent[PATCH] x86: increase MAX_MP_BUSSES on default arch (diff)
downloadlinux-ef16b5194f3233a11851180cd82eafb76542047d.tar.xz
linux-ef16b5194f3233a11851180cd82eafb76542047d.zip
[PATCH] exit early in floppy_init when no floppy exists
modprobe -v floppy on a Apple G5 writes incorrect stuff to dmesg: Floppy drive(s): fd0 is 2.88M The reason is that the legacy io check happens very late, when part of the floppy stuff is already initialized. check_legacy_ioport() returns either -ENODEV right away, or it walks the device-tree looking for a floppy node. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/floppy.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 5109fa37c662..ad1d7065a1b2 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -4177,6 +4177,11 @@ static int __init floppy_init(void)
int i, unit, drive;
int err, dr;
+#if defined(CONFIG_PPC_MERGE)
+ if (check_legacy_ioport(FDC1))
+ return -ENODEV;
+#endif
+
raw_cmd = NULL;
for (dr = 0; dr < N_DRIVE; dr++) {
@@ -4234,13 +4239,6 @@ static int __init floppy_init(void)
}
use_virtual_dma = can_use_virtual_dma & 1;
-#if defined(CONFIG_PPC_MERGE)
- if (check_legacy_ioport(FDC1)) {
- del_timer(&fd_timeout);
- err = -ENODEV;
- goto out_unreg_region;
- }
-#endif
fdc_state[0].address = FDC1;
if (fdc_state[0].address == -1) {
del_timer(&fd_timeout);