* [PATCH 1/2] regulator: wm831x-ldo: Convert to devm_request_threaded_irq
@ 2012-06-13 1:59 Axel Lin
2012-06-13 2:00 ` [PATCH 2/2] regulator: wm831x-isink: " Axel Lin
2012-06-13 9:30 ` [PATCH 1/2] regulator: wm831x-ldo: " Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2012-06-13 1:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Liam Girdwood, Mark Brown
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/wm831x-ldo.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c
index f23d020e9..ebe5af4 100644
--- a/drivers/regulator/wm831x-ldo.c
+++ b/drivers/regulator/wm831x-ldo.c
@@ -322,9 +322,9 @@ static __devinit int wm831x_gp_ldo_probe(struct platform_device *pdev)
}
irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
- ret = request_threaded_irq(irq, NULL, wm831x_ldo_uv_irq,
- IRQF_TRIGGER_RISING, ldo->name,
- ldo);
+ ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
+ wm831x_ldo_uv_irq, IRQF_TRIGGER_RISING,
+ ldo->name, ldo);
if (ret != 0) {
dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
irq, ret);
@@ -346,9 +346,6 @@ static __devexit int wm831x_gp_ldo_remove(struct platform_device *pdev)
struct wm831x_ldo *ldo = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
-
- free_irq(wm831x_irq(ldo->wm831x,
- platform_get_irq_byname(pdev, "UV")), ldo);
regulator_unregister(ldo->regulator);
return 0;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] regulator: wm831x-isink: Convert to devm_request_threaded_irq
2012-06-13 1:59 [PATCH 1/2] regulator: wm831x-ldo: Convert to devm_request_threaded_irq Axel Lin
@ 2012-06-13 2:00 ` Axel Lin
2012-06-13 9:30 ` [PATCH 1/2] regulator: wm831x-ldo: " Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Axel Lin @ 2012-06-13 2:00 UTC (permalink / raw)
To: linux-kernel; +Cc: Liam Girdwood, Mark Brown
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/wm831x-isink.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c
index 0d207c2..1d414d2 100644
--- a/drivers/regulator/wm831x-isink.c
+++ b/drivers/regulator/wm831x-isink.c
@@ -203,8 +203,9 @@ static __devinit int wm831x_isink_probe(struct platform_device *pdev)
}
irq = wm831x_irq(wm831x, platform_get_irq(pdev, 0));
- ret = request_threaded_irq(irq, NULL, wm831x_isink_irq,
- IRQF_TRIGGER_RISING, isink->name, isink);
+ ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
+ wm831x_isink_irq, IRQF_TRIGGER_RISING,
+ isink->name, isink);
if (ret != 0) {
dev_err(&pdev->dev, "Failed to request ISINK IRQ %d: %d\n",
irq, ret);
@@ -226,9 +227,6 @@ static __devexit int wm831x_isink_remove(struct platform_device *pdev)
struct wm831x_isink *isink = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
-
- free_irq(wm831x_irq(isink->wm831x, platform_get_irq(pdev, 0)), isink);
-
regulator_unregister(isink->regulator);
return 0;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] regulator: wm831x-ldo: Convert to devm_request_threaded_irq
2012-06-13 1:59 [PATCH 1/2] regulator: wm831x-ldo: Convert to devm_request_threaded_irq Axel Lin
2012-06-13 2:00 ` [PATCH 2/2] regulator: wm831x-isink: " Axel Lin
@ 2012-06-13 9:30 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2012-06-13 9:30 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Liam Girdwood
[-- Attachment #1: Type: text/plain, Size: 548 bytes --]
On Wed, Jun 13, 2012 at 09:59:27AM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
No, this (and generally a large proportion of possible usages of
devm_request_threaded_irq()) is a bad idea - we need to ensure that the
interrupt cannot fire when we're not in a position to handle it which in
thi case means after the regulator is unregistered. Since we're not
doing anything to explicitly quiesce the interrupt other than free it we
need to ensure that the free_irq() happens strictly before the regulator
is unregistered.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-13 9:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-13 1:59 [PATCH 1/2] regulator: wm831x-ldo: Convert to devm_request_threaded_irq Axel Lin
2012-06-13 2:00 ` [PATCH 2/2] regulator: wm831x-isink: " Axel Lin
2012-06-13 9:30 ` [PATCH 1/2] regulator: wm831x-ldo: " Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox