Commit ef16b519 authored by Olaf Hering's avatar Olaf Hering Committed by Linus Torvalds

[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: default avatarOlaf Hering <olaf@aepfle.de>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a9aa141c
...@@ -4177,6 +4177,11 @@ static int __init floppy_init(void) ...@@ -4177,6 +4177,11 @@ static int __init floppy_init(void)
int i, unit, drive; int i, unit, drive;
int err, dr; int err, dr;
#if defined(CONFIG_PPC_MERGE)
if (check_legacy_ioport(FDC1))
return -ENODEV;
#endif
raw_cmd = NULL; raw_cmd = NULL;
for (dr = 0; dr < N_DRIVE; dr++) { for (dr = 0; dr < N_DRIVE; dr++) {
...@@ -4234,13 +4239,6 @@ static int __init floppy_init(void) ...@@ -4234,13 +4239,6 @@ static int __init floppy_init(void)
} }
use_virtual_dma = can_use_virtual_dma & 1; 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; fdc_state[0].address = FDC1;
if (fdc_state[0].address == -1) { if (fdc_state[0].address == -1) {
del_timer(&fd_timeout); del_timer(&fd_timeout);
......
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