diff options
Diffstat (limited to 'drivers/char/dtlk.c')
-rw-r--r-- | drivers/char/dtlk.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c index d8dbdb916232..abde6ddefe69 100644 --- a/drivers/char/dtlk.c +++ b/drivers/char/dtlk.c | |||
@@ -62,7 +62,6 @@ | |||
62 | #include <linux/init.h> /* for __init, module_{init,exit} */ | 62 | #include <linux/init.h> /* for __init, module_{init,exit} */ |
63 | #include <linux/poll.h> /* for POLLIN, etc. */ | 63 | #include <linux/poll.h> /* for POLLIN, etc. */ |
64 | #include <linux/dtlk.h> /* local header file for DoubleTalk values */ | 64 | #include <linux/dtlk.h> /* local header file for DoubleTalk values */ |
65 | #include <linux/smp_lock.h> | ||
66 | 65 | ||
67 | #ifdef TRACING | 66 | #ifdef TRACING |
68 | #define TRACE_TEXT(str) printk(str); | 67 | #define TRACE_TEXT(str) printk(str); |
@@ -325,16 +324,22 @@ static int dtlk_release(struct inode *inode, struct file *file) | |||
325 | 324 | ||
326 | static int __init dtlk_init(void) | 325 | static int __init dtlk_init(void) |
327 | { | 326 | { |
327 | int err; | ||
328 | |||
328 | dtlk_port_lpc = 0; | 329 | dtlk_port_lpc = 0; |
329 | dtlk_port_tts = 0; | 330 | dtlk_port_tts = 0; |
330 | dtlk_busy = 0; | 331 | dtlk_busy = 0; |
331 | dtlk_major = register_chrdev(0, "dtlk", &dtlk_fops); | 332 | dtlk_major = register_chrdev(0, "dtlk", &dtlk_fops); |
332 | if (dtlk_major == 0) { | 333 | if (dtlk_major < 0) { |
333 | printk(KERN_ERR "DoubleTalk PC - cannot register device\n"); | 334 | printk(KERN_ERR "DoubleTalk PC - cannot register device\n"); |
334 | return 0; | 335 | return dtlk_major; |
336 | } | ||
337 | err = dtlk_dev_probe(); | ||
338 | if (err) { | ||
339 | unregister_chrdev(dtlk_major, "dtlk"); | ||
340 | return err; | ||
335 | } | 341 | } |
336 | if (dtlk_dev_probe() == 0) | 342 | printk(", MAJOR %d\n", dtlk_major); |
337 | printk(", MAJOR %d\n", dtlk_major); | ||
338 | 343 | ||
339 | init_waitqueue_head(&dtlk_process_list); | 344 | init_waitqueue_head(&dtlk_process_list); |
340 | 345 | ||