mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
To: linux-kernel@vger.kernel.org
Cc: Anton Vorontsov <cbouatmailru@gmail.com>,
	Anton Vorontsov <anton.vorontsov@linaro.org>,
	Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Subject: [PATCH] max17042_battery: fix driver exit function
Date: Mon, 26 Mar 2012 15:38:26 +0530	[thread overview]
Message-ID: <1332756506-6905-1-git-send-email-ramakrishna.pallala@intel.com> (raw)

This patch frees the irq and sets the i2c client
data to NULL in driver remove function.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
---
 drivers/power/max17042_battery.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/power/max17042_battery.c b/drivers/power/max17042_battery.c
index abf3400..d4868c5 100644
--- a/drivers/power/max17042_battery.c
+++ b/drivers/power/max17042_battery.c
@@ -721,6 +721,10 @@ static int __devexit max17042_remove(struct i2c_client *client)
 	struct max17042_chip *chip = i2c_get_clientdata(client);
 
 	power_supply_unregister(&chip->battery);
+	if (client->irq)
+		free_irq(client->irq, chip);
+	i2c_set_clientdata(client, NULL);
+
 	return 0;
 }
 
-- 
1.7.0.4


             reply	other threads:[~2012-03-26 18:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26 10:08 Ramakrishna Pallala [this message]
2012-04-10  5:20 ` Pallala, Ramakrishna
2012-05-05  2:36   ` Anton Vorontsov
2012-05-05  4:42     ` Pallala, Ramakrishna

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=1332756506-6905-1-git-send-email-ramakrishna.pallala@intel.com \
    --to=ramakrishna.pallala@intel.com \
    --cc=anton.vorontsov@linaro.org \
    --cc=cbouatmailru@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®