aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/dtlk.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/char/dtlk.c b/drivers/char/dtlk.c
index 9695f88badc6..abde6ddefe69 100644
--- a/drivers/char/dtlk.c
+++ b/drivers/char/dtlk.c
@@ -324,16 +324,22 @@ static int dtlk_release(struct inode *inode, struct file *file)
324 324
325static int __init dtlk_init(void) 325static int __init dtlk_init(void)
326{ 326{
327 int err;
328
327 dtlk_port_lpc = 0; 329 dtlk_port_lpc = 0;
328 dtlk_port_tts = 0; 330 dtlk_port_tts = 0;
329 dtlk_busy = 0; 331 dtlk_busy = 0;
330 dtlk_major = register_chrdev(0, "dtlk", &dtlk_fops); 332 dtlk_major = register_chrdev(0, "dtlk", &dtlk_fops);
331 if (dtlk_major == 0) { 333 if (dtlk_major < 0) {
332 printk(KERN_ERR "DoubleTalk PC - cannot register device\n"); 334 printk(KERN_ERR "DoubleTalk PC - cannot register device\n");
333 return 0; 335 return dtlk_major;
336 }
337 err = dtlk_dev_probe();
338 if (err) {
339 unregister_chrdev(dtlk_major, "dtlk");
340 return err;
334 } 341 }
335 if (dtlk_dev_probe() == 0) 342 printk(", MAJOR %d\n", dtlk_major);
336 printk(", MAJOR %d\n", dtlk_major);
337 343
338 init_waitqueue_head(&dtlk_process_list); 344 init_waitqueue_head(&dtlk_process_list);
339 345