aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorEric Piel <eric.piel@tremplin-utc.net>2009-06-16 18:34:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 22:47:56 -0400
commitc28842421cb6a29fd952043381bc5391bdf6be50 (patch)
tree5d906c515d8374c61da58b1ccdc4d8125a5546fa /drivers/hwmon
parent4b324126e0c6c3a5080ca3ec0981e8766ed6f1ee (diff)
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: Eric Piel <eric.piel@tremplin-utc.net> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/lis3lv02d.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/hwmon/lis3lv02d.c b/drivers/hwmon/lis3lv02d.c
index 778eb7795983..17f200341bc1 100644
--- a/drivers/hwmon/lis3lv02d.c
+++ b/drivers/hwmon/lis3lv02d.c
@@ -199,7 +199,6 @@ static int lis3lv02d_misc_open(struct inode *inode, struct file *file)
199 return -EBUSY; 199 return -EBUSY;
200 } 200 }
201 lis3lv02d_increase_use(&lis3_dev); 201 lis3lv02d_increase_use(&lis3_dev);
202 printk("lis3: registered interrupt %d\n", lis3_dev.irq);
203 return 0; 202 return 0;
204} 203}
205 204
@@ -378,7 +377,8 @@ void lis3lv02d_joystick_disable(void)
378 if (!lis3_dev.idev) 377 if (!lis3_dev.idev)
379 return; 378 return;
380 379
381 misc_deregister(&lis3lv02d_misc_device); 380 if (lis3_dev.irq)
381 misc_deregister(&lis3lv02d_misc_device);
382 input_unregister_device(lis3_dev.idev); 382 input_unregister_device(lis3_dev.idev);
383 lis3_dev.idev = NULL; 383 lis3_dev.idev = NULL;
384} 384}
@@ -493,8 +493,6 @@ int lis3lv02d_init_device(struct lis3lv02d *dev)
493 if (lis3lv02d_joystick_enable()) 493 if (lis3lv02d_joystick_enable())
494 printk(KERN_ERR DRIVER_NAME ": joystick initialization failed\n"); 494 printk(KERN_ERR DRIVER_NAME ": joystick initialization failed\n");
495 495
496 printk("lis3_init_device: irq %d\n", dev->irq);
497
498 /* bail if we did not get an IRQ from the bus layer */ 496 /* bail if we did not get an IRQ from the bus layer */
499 if (!dev->irq) { 497 if (!dev->irq) {
500 printk(KERN_ERR DRIVER_NAME 498 printk(KERN_ERR DRIVER_NAME
@@ -502,7 +500,6 @@ int lis3lv02d_init_device(struct lis3lv02d *dev)
502 goto out; 500 goto out;
503 } 501 }
504 502
505 printk("lis3: registering device\n");
506 if (misc_register(&lis3lv02d_misc_device)) 503 if (misc_register(&lis3lv02d_misc_device))
507 printk(KERN_ERR DRIVER_NAME ": misc_register failed\n"); 504 printk(KERN_ERR DRIVER_NAME ": misc_register failed\n");
508out: 505out: