linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] max17042_battery: fix driver exit function
@ 2012-03-26 10:08 Ramakrishna Pallala
  2012-04-10  5:20 ` Pallala, Ramakrishna
  0 siblings, 1 reply; 4+ messages in thread
From: Ramakrishna Pallala @ 2012-03-26 10:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: Anton Vorontsov, Anton Vorontsov, Ramakrishna Pallala

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] max17042_battery: fix driver exit function
  2012-03-26 10:08 [PATCH] max17042_battery: fix driver exit function Ramakrishna Pallala
@ 2012-04-10  5:20 ` Pallala, Ramakrishna
  2012-05-05  2:36   ` Anton Vorontsov
  0 siblings, 1 reply; 4+ messages in thread
From: Pallala, Ramakrishna @ 2012-04-10  5:20 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linux-kernel, Pallala, Ramakrishna

Hi Anton,

> From: Pallala, Ramakrishna
> Sent: Monday, March 26, 2012 3:38 PM
> To: linux-kernel@vger.kernel.org
> Cc: Anton Vorontsov; Anton Vorontsov; Pallala, Ramakrishna
> Subject: [PATCH] max17042_battery: fix driver exit function
> 
> 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;
>  }

I have not received any comments for this patch.
Can I assume that this patch is in your merge queue?

Thanks,
Ram

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] max17042_battery: fix driver exit function
  2012-04-10  5:20 ` Pallala, Ramakrishna
@ 2012-05-05  2:36   ` Anton Vorontsov
  2012-05-05  4:42     ` Pallala, Ramakrishna
  0 siblings, 1 reply; 4+ messages in thread
From: Anton Vorontsov @ 2012-05-05  2:36 UTC (permalink / raw)
  To: Pallala, Ramakrishna; +Cc: linux-kernel

Hello Ramakrishna,

On Tue, Apr 10, 2012 at 05:20:33AM +0000, Pallala, Ramakrishna wrote:
[...]
> >  	power_supply_unregister(&chip->battery);
> > +	if (client->irq)
> > +		free_irq(client->irq, chip);
> > +	i2c_set_clientdata(client, NULL);
> > +
> >  	return 0;
> >  }
> 
> I have not received any comments for this patch.
> Can I assume that this patch is in your merge queue?

Applied, but I removed i2c_set_clientdata(client, NULL) line in this
patch. It is not be required nowadays, I2C core does it by itself.

Plus, I changed the order of the calls: we should free irq first, then
unregister the power supply (btw, you might want to fix probe function
as well: it should request irq only after power supply object is
fully usable).

Thanks!

-- 
Anton Vorontsov
Email: cbouatmailru@gmail.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] max17042_battery: fix driver exit function
  2012-05-05  2:36   ` Anton Vorontsov
@ 2012-05-05  4:42     ` Pallala, Ramakrishna
  0 siblings, 0 replies; 4+ messages in thread
From: Pallala, Ramakrishna @ 2012-05-05  4:42 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 981 bytes --]

> On Tue, Apr 10, 2012 at 05:20:33AM +0000, Pallala, Ramakrishna wrote:
> [...]
> > >  	power_supply_unregister(&chip->battery);
> > > +	if (client->irq)
> > > +		free_irq(client->irq, chip);
> > > +	i2c_set_clientdata(client, NULL);
> > > +
> > >  	return 0;
> > >  }
> >
> > I have not received any comments for this patch.
> > Can I assume that this patch is in your merge queue?
> 
> Applied, but I removed i2c_set_clientdata(client, NULL) line in this patch. It is not be
> required nowadays, I2C core does it by itself.
> 
> Plus, I changed the order of the calls: we should free irq first, then unregister the
> power supply (btw, you might want to fix probe function as well: it should request irq
> only after power supply object is fully usable).

Thanks for the fix. I will look into the probe().

Thanks,
Ram
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-05  4:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-26 10:08 [PATCH] max17042_battery: fix driver exit function Ramakrishna Pallala
2012-04-10  5:20 ` Pallala, Ramakrishna
2012-05-05  2:36   ` Anton Vorontsov
2012-05-05  4:42     ` Pallala, Ramakrishna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).