All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Éric Piel" <eric.piel@tremplin-utc.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Pavel Machek <pavel@ucw.cz>
Subject: [PATCH 1/4] lis3: fix misc device unregistering and printk
Date: Thu, 21 May 2009 11:29:46 +0200	[thread overview]
Message-ID: <4A151F0A.9070405@tremplin-utc.net> (raw)
In-Reply-To: <4A151E9F.1080405@tremplin-utc.net>


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: Éric Piel <eric.piel@tremplin-utc.net>
---
 drivers/hwmon/lis3lv02d.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/hwmon/lis3lv02d.c b/drivers/hwmon/lis3lv02d.c
index 778eb77..17f2003 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)
 		return -EBUSY;
 	}
 	lis3lv02d_increase_use(&lis3_dev);
-	printk("lis3: registered interrupt %d\n", lis3_dev.irq);
 	return 0;
 }
 
@@ -378,7 +377,8 @@ void lis3lv02d_joystick_disable(void)
 	if (!lis3_dev.idev)
 		return;
 
-	misc_deregister(&lis3lv02d_misc_device);
+	if (lis3_dev.irq)
+		misc_deregister(&lis3lv02d_misc_device);
 	input_unregister_device(lis3_dev.idev);
 	lis3_dev.idev = NULL;
 }
@@ -493,8 +493,6 @@ int lis3lv02d_init_device(struct lis3lv02d *dev)
 	if (lis3lv02d_joystick_enable())
 		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 */
 	if (!dev->irq) {
 		printk(KERN_ERR DRIVER_NAME
@@ -502,7 +500,6 @@ int lis3lv02d_init_device(struct lis3lv02d *dev)
 		goto out;
 	}
 
-	printk("lis3: registering device\n");
 	if (misc_register(&lis3lv02d_misc_device))
 		printk(KERN_ERR DRIVER_NAME ": misc_register failed\n");
 out:
-- 
1.6.2.4




  reply	other threads:[~2009-05-21  9:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-21  9:27 [PATCH 0/4] lis3: clean up and updates Éric Piel
2009-05-21  9:29 ` Éric Piel [this message]
2009-05-21 10:48   ` [PATCH 1/4] lis3: fix misc device unregistering and printk Pavel Machek
2009-05-21  9:30 ` [PATCH 2/4] lis3: remove automatic shutdown of the device Éric Piel
2009-05-21 11:36   ` Pavel Machek
2009-05-21 11:55     ` Éric Piel
2009-05-21 12:08       ` Pavel Machek
2009-05-21  9:31 ` [PATCH 3/4] lis3: use input_polled_device Éric Piel
2009-05-21  9:33 ` [PATCH 4/4] lis3: Add three new laptop models Éric Piel
2009-05-21 10:49   ` Pavel Machek
2009-05-21 11:07     ` Éric Piel
2009-05-21 11:36       ` Isaac702
     [not found]       ` <36a8c4f10905210424i65f5efadjdd6f13dea77cb2e6@mail.gmail.com>
2009-05-21 11:38         ` Éric Piel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A151F0A.9070405@tremplin-utc.net \
    --to=eric.piel@tremplin-utc.net \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.