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>
This commit is contained in:
parent
63fb3149c8
commit
41c7a879d1
1 changed files with 7 additions and 9 deletions
|
@ -288,7 +288,8 @@ static int wm831x_gp_ldo_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
|
irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
|
||||||
ret = request_threaded_irq(irq, NULL, wm831x_ldo_uv_irq,
|
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
|
||||||
|
wm831x_ldo_uv_irq,
|
||||||
IRQF_TRIGGER_RISING, ldo->name,
|
IRQF_TRIGGER_RISING, ldo->name,
|
||||||
ldo);
|
ldo);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
@ -311,8 +312,6 @@ static int wm831x_gp_ldo_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct wm831x_ldo *ldo = platform_get_drvdata(pdev);
|
struct wm831x_ldo *ldo = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
free_irq(wm831x_irq(ldo->wm831x,
|
|
||||||
platform_get_irq_byname(pdev, "UV")), ldo);
|
|
||||||
regulator_unregister(ldo->regulator);
|
regulator_unregister(ldo->regulator);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -514,7 +513,8 @@ static int wm831x_aldo_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
|
irq = wm831x_irq(wm831x, platform_get_irq_byname(pdev, "UV"));
|
||||||
ret = request_threaded_irq(irq, NULL, wm831x_ldo_uv_irq,
|
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
|
||||||
|
wm831x_ldo_uv_irq,
|
||||||
IRQF_TRIGGER_RISING, ldo->name, ldo);
|
IRQF_TRIGGER_RISING, ldo->name, ldo);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
|
dev_err(&pdev->dev, "Failed to request UV IRQ %d: %d\n",
|
||||||
|
@ -536,8 +536,6 @@ static int wm831x_aldo_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct wm831x_ldo *ldo = platform_get_drvdata(pdev);
|
struct wm831x_ldo *ldo = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
free_irq(wm831x_irq(ldo->wm831x, platform_get_irq_byname(pdev, "UV")),
|
|
||||||
ldo);
|
|
||||||
regulator_unregister(ldo->regulator);
|
regulator_unregister(ldo->regulator);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue