summaryrefslogtreecommitdiffstats
path: root/drivers/char/dtlk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/dtlk.c')
-rw-r--r--drivers/char/dtlk.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
index ac913935b..58ce08712 100644
--- a/drivers/char/dtlk.c
+++ b/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 @@ static int dtlk_release(struct inode *inode, struct file *file)
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 @@ static void __exit dtlk_cleanup (void)
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);
}