[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>

authored by Olaf Hering and committed by Linus Torvalds ef16b519 a9aa141c

+5 -7
+5 -7
drivers/block/floppy.c
··· 4177 4177 int i, unit, drive; 4178 4178 int err, dr; 4179 4179 4180 + #if defined(CONFIG_PPC_MERGE) 4181 + if (check_legacy_ioport(FDC1)) 4182 + return -ENODEV; 4183 + #endif 4184 + 4180 4185 raw_cmd = NULL; 4181 4186 4182 4187 for (dr = 0; dr < N_DRIVE; dr++) { ··· 4239 4234 } 4240 4235 4241 4236 use_virtual_dma = can_use_virtual_dma & 1; 4242 - #if defined(CONFIG_PPC_MERGE) 4243 - if (check_legacy_ioport(FDC1)) { 4244 - del_timer(&fd_timeout); 4245 - err = -ENODEV; 4246 - goto out_unreg_region; 4247 - } 4248 - #endif 4249 4237 fdc_state[0].address = FDC1; 4250 4238 if (fdc_state[0].address == -1) { 4251 4239 del_timer(&fd_timeout);