Commit c2884242 authored by Eric Piel's avatar Eric Piel Committed by Linus Torvalds

lis3: fix misc device unregistering and printk

Can only unregister the misc device if it was registered before.  Also
remove debugging messages, which in addition were not properly formated.
Signed-off-by: default avatarEric Piel <eric.piel@tremplin-utc.net>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4b324126
...@@ -199,7 +199,6 @@ static int lis3lv02d_misc_open(struct inode *inode, struct file *file) ...@@ -199,7 +199,6 @@ static int lis3lv02d_misc_open(struct inode *inode, struct file *file)
return -EBUSY; return -EBUSY;
} }
lis3lv02d_increase_use(&lis3_dev); lis3lv02d_increase_use(&lis3_dev);
printk("lis3: registered interrupt %d\n", lis3_dev.irq);
return 0; return 0;
} }
...@@ -378,7 +377,8 @@ void lis3lv02d_joystick_disable(void) ...@@ -378,7 +377,8 @@ void lis3lv02d_joystick_disable(void)
if (!lis3_dev.idev) if (!lis3_dev.idev)
return; return;
misc_deregister(&lis3lv02d_misc_device); if (lis3_dev.irq)
misc_deregister(&lis3lv02d_misc_device);
input_unregister_device(lis3_dev.idev); input_unregister_device(lis3_dev.idev);
lis3_dev.idev = NULL; lis3_dev.idev = NULL;
} }
...@@ -493,8 +493,6 @@ int lis3lv02d_init_device(struct lis3lv02d *dev) ...@@ -493,8 +493,6 @@ int lis3lv02d_init_device(struct lis3lv02d *dev)
if (lis3lv02d_joystick_enable()) if (lis3lv02d_joystick_enable())
printk(KERN_ERR DRIVER_NAME ": joystick initialization failed\n"); printk(KERN_ERR DRIVER_NAME ": joystick initialization failed\n");
printk("lis3_init_device: irq %d\n", dev->irq);
/* bail if we did not get an IRQ from the bus layer */ /* bail if we did not get an IRQ from the bus layer */
if (!dev->irq) { if (!dev->irq) {
printk(KERN_ERR DRIVER_NAME printk(KERN_ERR DRIVER_NAME
...@@ -502,7 +500,6 @@ int lis3lv02d_init_device(struct lis3lv02d *dev) ...@@ -502,7 +500,6 @@ int lis3lv02d_init_device(struct lis3lv02d *dev)
goto out; goto out;
} }
printk("lis3: registering device\n");
if (misc_register(&lis3lv02d_misc_device)) if (misc_register(&lis3lv02d_misc_device))
printk(KERN_ERR DRIVER_NAME ": misc_register failed\n"); printk(KERN_ERR DRIVER_NAME ": misc_register failed\n");
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment