linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: twl6040: drop devm_free_irq of devm_ allocated irq
@ 2013-09-25  7:37 Wei Yongjun
  2013-09-25 10:08 ` Lee Jones
  2013-09-25 10:10 ` Sachin Kamat
  0 siblings, 2 replies; 4+ messages in thread
From: Wei Yongjun @ 2013-09-25  7:37 UTC (permalink / raw)
  To: sameo, lee.jones; +Cc: yongjun_wei, linux-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

The devm_request_irq function allocates irq that is released
when a driver detaches. Thus, there is no reason to explicitly
call devm_free_irq in probe or remove functions.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/mfd/twl6040.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/mfd/twl6040.c b/drivers/mfd/twl6040.c
index daf6694..7361dbe 100644
--- a/drivers/mfd/twl6040.c
+++ b/drivers/mfd/twl6040.c
@@ -619,7 +619,7 @@ static int twl6040_probe(struct i2c_client *client,
 					"twl6040_irq_th", twl6040);
 	if (ret) {
 		dev_err(twl6040->dev, "Thermal IRQ request failed: %d\n", ret);
-		goto thirq_err;
+		goto readyirq_err;
 	}
 
 	/* dual-access registers controlled by I2C only */
@@ -659,14 +659,10 @@ static int twl6040_probe(struct i2c_client *client,
 	ret = mfd_add_devices(&client->dev, -1, twl6040->cells, children,
 			      NULL, 0, NULL);
 	if (ret)
-		goto mfd_err;
+		goto readyirq_err;
 
 	return 0;
 
-mfd_err:
-	devm_free_irq(&client->dev, twl6040->irq_th, twl6040);
-thirq_err:
-	devm_free_irq(&client->dev, twl6040->irq_ready, twl6040);
 readyirq_err:
 	regmap_del_irq_chip(twl6040->irq, twl6040->irq_data);
 gpio_err:
@@ -684,8 +680,6 @@ static int twl6040_remove(struct i2c_client *client)
 	if (twl6040->power_count)
 		twl6040_power(twl6040, 0);
 
-	devm_free_irq(&client->dev, twl6040->irq_ready, twl6040);
-	devm_free_irq(&client->dev, twl6040->irq_th, twl6040);
 	regmap_del_irq_chip(twl6040->irq, twl6040->irq_data);
 
 	mfd_remove_devices(&client->dev);


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

* Re: [PATCH] mfd: twl6040: drop devm_free_irq of devm_ allocated irq
  2013-09-25  7:37 [PATCH] mfd: twl6040: drop devm_free_irq of devm_ allocated irq Wei Yongjun
@ 2013-09-25 10:08 ` Lee Jones
  2013-09-25 10:10 ` Sachin Kamat
  1 sibling, 0 replies; 4+ messages in thread
From: Lee Jones @ 2013-09-25 10:08 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: sameo, yongjun_wei, linux-kernel

On Wed, 25 Sep 2013, Wei Yongjun wrote:

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> The devm_request_irq function allocates irq that is released
> when a driver detaches. Thus, there is no reason to explicitly
> call devm_free_irq in probe or remove functions.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/mfd/twl6040.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)

Applied, thanks.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] mfd: twl6040: drop devm_free_irq of devm_ allocated irq
  2013-09-25  7:37 [PATCH] mfd: twl6040: drop devm_free_irq of devm_ allocated irq Wei Yongjun
  2013-09-25 10:08 ` Lee Jones
@ 2013-09-25 10:10 ` Sachin Kamat
  2013-09-25 10:28   ` Lee Jones
  1 sibling, 1 reply; 4+ messages in thread
From: Sachin Kamat @ 2013-09-25 10:10 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: sameo, Lee Jones, yongjun_wei, LKML

On 25 September 2013 13:07, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> -       devm_free_irq(&client->dev, twl6040->irq_ready, twl6040);
> -       devm_free_irq(&client->dev, twl6040->irq_th, twl6040);
>         regmap_del_irq_chip(twl6040->irq, twl6040->irq_data);

Now that the freeing of irq will happen after regmap_del_irq_chip,
wouldn't this cause any ordering related issues?


-- 
With warm regards,
Sachin

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

* Re: [PATCH] mfd: twl6040: drop devm_free_irq of devm_ allocated irq
  2013-09-25 10:10 ` Sachin Kamat
@ 2013-09-25 10:28   ` Lee Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Lee Jones @ 2013-09-25 10:28 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: Wei Yongjun, sameo, yongjun_wei, LKML

On Wed, 25 Sep 2013, Sachin Kamat wrote:

> On 25 September 2013 13:07, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> > From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> >
> > -       devm_free_irq(&client->dev, twl6040->irq_ready, twl6040);
> > -       devm_free_irq(&client->dev, twl6040->irq_th, twl6040);
> >         regmap_del_irq_chip(twl6040->irq, twl6040->irq_data);
> 
> Now that the freeing of irq will happen after regmap_del_irq_chip,
> wouldn't this cause any ordering related issues?

I don't believe there is a requirement to free all associated IRQs
before deleting an irqchip.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2013-09-25 10:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-25  7:37 [PATCH] mfd: twl6040: drop devm_free_irq of devm_ allocated irq Wei Yongjun
2013-09-25 10:08 ` Lee Jones
2013-09-25 10:10 ` Sachin Kamat
2013-09-25 10:28   ` Lee Jones

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).