patch-2.4.0-test3 linux/drivers/char/misc.c

Next file: linux/drivers/char/msp3400.c
Previous file: linux/drivers/char/lp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/drivers/char/misc.c linux/drivers/char/misc.c
@@ -75,6 +75,7 @@
 extern int rtc_sun_init(void);		/* Combines MK48T02 and MK48T08 */
 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 pc110pad_init(void);
@@ -134,8 +135,11 @@
 
 	old_fops = file->f_op;
 	file->f_op = fops_get(c->fops);
-	if (file->f_op && file->f_op->open)
-		err=file->f_op->open(inode,file);
+	if (file->f_op) {
+		err = 0;
+		if (file->f_op->open)
+			err=file->f_op->open(inode,file);
+	}
 	if (err) {
 		fops_put(file->f_op);
 		file->f_op = fops_get(old_fops);
@@ -190,7 +194,7 @@
 	if (misc->minor < DYNAMIC_MINORS)
 		misc_minors[misc->minor >> 3] |= 1 << (misc->minor & 7);
 	if (!devfs_handle)
-		devfs_handle = devfs_mk_dir (NULL, "misc", 4, NULL);
+		devfs_handle = devfs_mk_dir (NULL, "misc", NULL);
 	misc->devfs_handle =
 	    devfs_register (devfs_handle, misc->name, DEVFS_FL_NONE,
 			    MISC_MAJOR, misc->minor,

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)