mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] 2.5.32 floppy init and misc fixes
@ 2002-08-29  8:17 Mikolaj J. Habryn
  2002-08-29 10:24 ` Mikael Pettersson
  0 siblings, 1 reply; 5+ messages in thread
From: Mikolaj J. Habryn @ 2002-08-29  8:17 UTC (permalink / raw)
  To: linux-kernel

The floppy driver doesn't clean up it's register_sys_device if it fails
to init correctly. The below patch adds the appropriate
unregister_sys_device in the various failure paths, and also includes
Ewan MacMahon's one-liner for working VCs on devfs-only machines, and a
couple of missing #includes. Minimum required to get 2.5.32 working on
my Portege.

m.

--- linux-2.5.32/drivers/char/console.c.orig	2002-08-29 14:07:59.000000000 +1000
+++ linux-2.5.32/drivers/char/console.c	2002-08-29 13:42:07.000000000 +1000
@@ -2526,6 +2526,7 @@
 
 	kbd_init();
 	console_map_init();
+	con_init_devfs();
 	vcs_init();
 	return 0;
 }
--- linux-2.5.32/drivers/block/floppy.c.orig	2002-08-29 16:17:30.000000000 +1000
+++ linux-2.5.32/drivers/block/floppy.c	2002-08-29 16:19:20.000000000 +1000
@@ -4235,6 +4235,7 @@
 	devfs_handle = devfs_mk_dir (NULL, "floppy", NULL);
 	if (register_blkdev(MAJOR_NR,"fd",&floppy_fops)) {
 		printk("Unable to get major %d for floppy\n",MAJOR_NR);
+		unregister_sys_device(&device_floppy);
 		return -EBUSY;
 	}
 
@@ -4269,6 +4270,7 @@
 		unregister_blkdev(MAJOR_NR,"fd");
 		del_timer(&fd_timeout);
 		blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
+		unregister_sys_device(&device_floppy);
 		return -ENODEV;
 	}
 #if N_FDC > 1
@@ -4280,6 +4282,7 @@
 		del_timer(&fd_timeout);
 		blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
 		unregister_blkdev(MAJOR_NR,"fd");
+		unregister_sys_device(&device_floppy);
 		return -EBUSY;
 	}
 
@@ -4343,6 +4346,7 @@
 			floppy_release_irq_and_dma();
 		blk_cleanup_queue(BLK_DEFAULT_QUEUE(MAJOR_NR));
 		unregister_blkdev(MAJOR_NR,"fd");
+		unregister_sys_device(&device_floppy);
 	}
 	
 	for (drive = 0; drive < N_DRIVE; drive++) {
--- linux-2.5.32/drivers/net/wireless/hermes.c.orig	2002-08-29 14:55:28.000000000 +1000
+++ linux-2.5.32/drivers/net/wireless/hermes.c	2002-08-29 14:56:03.000000000 +1000
@@ -45,6 +45,7 @@
 #include <linux/threads.h>
 #include <linux/smp.h>
 #include <asm/io.h>
+#include <linux/sched.h>
 #include <linux/ptrace.h>
 #include <linux/delay.h>
 #include <linux/init.h>
--- linux-2.5.32/drivers/char/toshiba.c.orig	2002-08-29 14:09:44.000000000 +1000
+++ linux-2.5.32/drivers/char/toshiba.c	2002-08-29 14:10:09.000000000 +1000
@@ -69,6 +69,7 @@
 #include <linux/init.h>
 #include <linux/stat.h>
 #include <linux/proc_fs.h>
+#include <linux/interrupt.h>
 
 #include <linux/toshiba.h>
 

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: [PATCH] 2.5.32 floppy init and misc fixes
@ 2002-08-31 14:51 Mikael Pettersson
  2002-09-02  3:51 ` Randy.Dunlap
  0 siblings, 1 reply; 5+ messages in thread
From: Mikael Pettersson @ 2002-08-31 14:51 UTC (permalink / raw)
  To: rddunlap; +Cc: linux-kernel

On Thu, 29 Aug 2002 10:30:14 -0700 (PDT), Randy.Dunlap wrote:
>On Thu, 29 Aug 2002, Mikael Pettersson wrote:
>
>| Floppy has many more problems.
...
>
>I would add one more: select delay timings are same as in 2.4:
>#define SEL_DLY (2*HZ/100)
>but HZ is not the same as in 2.4...

I took a quick glance through floppy.c, and all HZ-dependent
delays seem to be in jiffies, so I think they are Ok.

/Mikael

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-09-02  3:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-29  8:17 [PATCH] 2.5.32 floppy init and misc fixes Mikolaj J. Habryn
2002-08-29 10:24 ` Mikael Pettersson
2002-08-29 17:30   ` Randy.Dunlap
2002-08-31 14:51 Mikael Pettersson
2002-09-02  3:51 ` Randy.Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®