* [PATCH] exit early in floppy_init when no floppy exists
@ 2006-08-29 8:07 Olaf Hering
2006-08-29 8:28 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 2+ messages in thread
From: Olaf Hering @ 2006-08-29 8:07 UTC (permalink / raw)
To: Andrew Morton, Benjamin Herrenschmidt, linux-kernel
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>
---
Can this go into 2.6.18 please? Our installer parses dmesg to find
floppy devices. Dont ask....
drivers/block/floppy.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
Index: linux-2.6.18-rc4/drivers/block/floppy.c
===================================================================
--- linux-2.6.18-rc4.orig/drivers/block/floppy.c
+++ linux-2.6.18-rc4/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);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] exit early in floppy_init when no floppy exists
2006-08-29 8:07 [PATCH] exit early in floppy_init when no floppy exists Olaf Hering
@ 2006-08-29 8:28 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2006-08-29 8:28 UTC (permalink / raw)
To: Olaf Hering; +Cc: Andrew Morton, linux-kernel
On Tue, 2006-08-29 at 10:07 +0200, Olaf Hering wrote:
> 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>
> ---
>
> Can this go into 2.6.18 please? Our installer parses dmesg to find
> floppy devices. Dont ask....
>
>
>
>
> drivers/block/floppy.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> Index: linux-2.6.18-rc4/drivers/block/floppy.c
> ===================================================================
> --- linux-2.6.18-rc4.orig/drivers/block/floppy.c
> +++ linux-2.6.18-rc4/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);
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-29 8:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-29 8:07 [PATCH] exit early in floppy_init when no floppy exists Olaf Hering
2006-08-29 8:28 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).