patch-2.3.46 linux/drivers/char/dtlk.c

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

diff -u --recursive --new-file v2.3.45/linux/drivers/char/dtlk.c linux/drivers/char/dtlk.c
@@ -64,6 +64,7 @@
 #include <linux/init.h>		/* for __init, module_{init,exit} */
 #include <linux/poll.h>		/* for POLLIN, etc. */
 #include <linux/dtlk.h>		/* local header file for DoubleTalk values */
+#include <linux/devfs_fs_kernel.h>
 
 #ifdef TRACING
 #define TRACE_TEXT(str) printk(str);
@@ -352,19 +353,25 @@
 	return 0;
 }
 
+static devfs_handle_t devfs_handle;
+
 static int __init dtlk_init(void)
 {
 	dtlk_port_lpc = 0;
 	dtlk_port_tts = 0;
 	dtlk_busy = 0;
 	dtlk_timer_active = 0;
-	dtlk_major = register_chrdev(0, "dtlk", &dtlk_fops);
+	dtlk_major = devfs_register_chrdev(0, "dtlk", &dtlk_fops);
 	if (dtlk_major == 0) {
 		printk(KERN_ERR "DoubleTalk PC - cannot register device\n");
 		return 0;
 	}
 	if (dtlk_dev_probe() == 0)
 		printk(", MAJOR %d\n", dtlk_major);
+	devfs_handle = devfs_register (NULL, "dtlk", 0, DEVFS_FL_NONE,
+				       dtlk_major, DTLK_MINOR,
+				       S_IFCHR | S_IRUSR | S_IWUSR, 0, 0,
+				       &dtlk_fops, NULL);
 
 	init_timer(&dtlk_timer);
 	dtlk_timer.function = dtlk_timer_tick;
@@ -383,7 +390,8 @@
 						   signals... */
 
 	dtlk_write_tts(DTLK_CLEAR);
-	unregister_chrdev(dtlk_major, "dtlk");
+	devfs_unregister_chrdev(dtlk_major, "dtlk");
+	devfs_unregister(devfs_handle);
 	release_region(dtlk_port_lpc, DTLK_IO_EXTENT);
 }
 

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