aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/wm831x-ldo.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-31 06:50:00 -0400
committerMark Brown <broonie@linaro.org>2013-09-16 19:27:53 -0400
commit41c7a879d1d637c0c9731682a822b1c3162b0764 (patch)
tree6bd12081bd5d069c9f564262fa16ad86d4a7af3a /drivers/regulator/wm831x-ldo.c
parent63fb3149c8ba2b0194ba7e967f2dafc1c8c0da69 (diff)
regulator: wm831x-ldo: Use devm_request_threaded_irq()
devm guarantees that resources are freed in the oposite order to that in which they are allocated. Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/wm831x-ldo.c')
-rw-r--r--drivers/regulator/wm831x-ldo.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c
index 1432b26ef2e9..5570f3e59170 100644
--- a/drivers/regulator/wm831x-ldo.c
+++ b/drivers/regulator/wm831x-ldo.c
@@ -288,9 +288,10 @@ static int wm831x_gp_ldo_probe(struct platform_device *pdev)
288 } 288 }
289 289
290 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV")); 290 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
291 ret = request_threaded_irq(irq, NULL, wm831x_ldo_uv_irq, 291 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
292 IRQF_TRIGGER_RISING, ldo->name, 292 wm831x_ldo_uv_irq,
293 ldo); 293 IRQF_TRIGGER_RISING, ldo->name,
294 ldo);
294 if (ret != 0) { 295 if (ret != 0) {
295 dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n", 296 dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
296 irq, ret); 297 irq, ret);
@@ -311,8 +312,6 @@ static int wm831x_gp_ldo_remove(struct platform_device *pdev)
311{ 312{
312 struct wm831x_ldo *ldo = platform_get_drvdata(pdev); 313 struct wm831x_ldo *ldo = platform_get_drvdata(pdev);
313 314
314 free_irq(wm831x_irq(ldo->wm831x,
315 platform_get_irq_byname(pdev, "UV")), ldo);
316 regulator_unregister(ldo->regulator); 315 regulator_unregister(ldo->regulator);
317 316
318 return 0; 317 return 0;
@@ -514,8 +513,9 @@ static int wm831x_aldo_probe(struct platform_device *pdev)
514 } 513 }
515 514
516 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV")); 515 irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
517 ret = request_threaded_irq(irq, NULL, wm831x_ldo_uv_irq, 516 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
518 IRQF_TRIGGER_RISING, ldo->name, ldo); 517 wm831x_ldo_uv_irq,
518 IRQF_TRIGGER_RISING, ldo->name, ldo);
519 if (ret != 0) { 519 if (ret != 0) {
520 dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n", 520 dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
521 irq, ret); 521 irq, ret);
@@ -536,8 +536,6 @@ static int wm831x_aldo_remove(struct platform_device *pdev)
536{ 536{
537 struct wm831x_ldo *ldo = platform_get_drvdata(pdev); 537 struct wm831x_ldo *ldo = platform_get_drvdata(pdev);
538 538
539 free_irq(wm831x_irq(ldo->wm831x, platform_get_irq_byname(pdev, "UV")),
540 ldo);
541 regulator_unregister(ldo->regulator); 539 regulator_unregister(ldo->regulator);
542 540
543 return 0; 541 return 0;