patch-2.4.4 linux/drivers/char/misc.c
Next file: linux/drivers/char/n_r3964.c
Previous file: linux/drivers/char/mem.c
Back to the patch index
Back to the overall index
- Lines: 53
- Date:
Fri Apr 13 20:26:07 2001
- Orig file:
v2.4.3/linux/drivers/char/misc.c
- Orig date:
Sun Mar 25 18:24:31 2001
diff -u --recursive --new-file v2.4.3/linux/drivers/char/misc.c linux/drivers/char/misc.c
@@ -73,10 +73,8 @@
extern int rtc_DP8570A_init(void);
extern int rtc_MK48T08_init(void);
extern int ds1286_init(void);
-extern int dsp56k_init(void);
extern int radio_init(void);
extern int pmu_device_init(void);
-extern int qpmouse_init(void);
extern int tosh_init(void);
static int misc_read_proc(char *buf, char **start, off_t offset,
@@ -173,10 +171,20 @@
int misc_register(struct miscdevice * misc)
{
static devfs_handle_t devfs_handle;
-
+ struct miscdevice *c;
+
if (misc->next || misc->prev)
return -EBUSY;
down(&misc_sem);
+ c = misc_list.next;
+
+ while ((c != &misc_list) && (c->minor != misc->minor))
+ c = c->next;
+ if (c != &misc_list) {
+ up(&misc_sem);
+ return -EBUSY;
+ }
+
if (misc->minor == MISC_DYNAMIC_MINOR) {
int i = DYNAMIC_MINORS;
while (--i >= 0)
@@ -245,9 +253,6 @@
int __init misc_init(void)
{
create_proc_read_entry("misc", 0, 0, misc_read_proc, NULL);
-#if defined CONFIG_82C710_MOUSE
- qpmouse_init();
-#endif
#ifdef CONFIG_MVME16x
rtc_MK48T08_init();
#endif
@@ -256,9 +261,6 @@
#endif
#ifdef CONFIG_SGI_DS1286
ds1286_init();
-#endif
-#ifdef CONFIG_ATARI_DSP56K
- dsp56k_init();
#endif
#ifdef CONFIG_MISC_RADIO
radio_init();
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)