diff options
author | Mark Brown | 2013-10-24 11:11:32 +0100 |
---|---|---|
committer | Mark Brown | 2013-10-24 11:11:32 +0100 |
commit | 420118d48311e0c4ef4aace5aede35079ecc2412 (patch) | |
tree | a4affbc11b9271d786b9c9e5711b1e7dc873d3e8 /drivers/regulator/wm831x-ldo.c | |
parent | 2a2bec6554e9e9d0ae351575ca1f72df1fa0f15f (diff) | |
parent | 32dadef2190efd2e06331825b11881daf100d6d9 (diff) |
Merge remote-tracking branch 'regulator/topic/alias' into regulator-next
Diffstat (limited to 'drivers/regulator/wm831x-ldo.c')
-rw-r--r-- | drivers/regulator/wm831x-ldo.c | 63 |
1 files changed, 15 insertions, 48 deletions
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c index 2205fbc2c37b..482ebe8f47aa 100644 --- a/drivers/regulator/wm831x-ldo.c +++ b/drivers/regulator/wm831x-ldo.c @@ -279,7 +279,8 @@ static int wm831x_gp_ldo_probe(struct platform_device *pdev) config.driver_data = ldo; config.regmap = wm831x->regmap; - ldo->regulator = regulator_register(&ldo->desc, &config); + ldo->regulator = devm_regulator_register(&pdev->dev, &ldo->desc, + &config); if (IS_ERR(ldo->regulator)) { ret = PTR_ERR(ldo->regulator); dev_err(wm831x->dev, "Failed to register LDO%d: %d\n", @@ -288,39 +289,26 @@ static 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); - goto err_regulator; + goto err; } platform_set_drvdata(pdev, ldo); return 0; -err_regulator: - regulator_unregister(ldo->regulator); err: return ret; } -static int wm831x_gp_ldo_remove(struct platform_device *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); - - return 0; -} - static struct platform_driver wm831x_gp_ldo_driver = { .probe = wm831x_gp_ldo_probe, - .remove = wm831x_gp_ldo_remove, .driver = { .name = "wm831x-ldo", .owner = THIS_MODULE, @@ -505,7 +493,8 @@ static int wm831x_aldo_probe(struct platform_device *pdev) config.driver_data = ldo; config.regmap = wm831x->regmap; - ldo->regulator = regulator_register(&ldo->desc, &config); + ldo->regulator = devm_regulator_register(&pdev->dev, &ldo->desc, + &config); if (IS_ERR(ldo->regulator)) { ret = PTR_ERR(ldo->regulator); dev_err(wm831x->dev, "Failed to register LDO%d: %d\n", @@ -514,38 +503,25 @@ static int wm831x_aldo_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); - goto err_regulator; + goto err; } platform_set_drvdata(pdev, ldo); return 0; -err_regulator: - regulator_unregister(ldo->regulator); err: return ret; } -static int wm831x_aldo_remove(struct platform_device *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); - - return 0; -} - static struct platform_driver wm831x_aldo_driver = { .probe = wm831x_aldo_probe, - .remove = wm831x_aldo_remove, .driver = { .name = "wm831x-aldo", .owner = THIS_MODULE, @@ -663,7 +639,8 @@ static int wm831x_alive_ldo_probe(struct platform_device *pdev) config.driver_data = ldo; config.regmap = wm831x->regmap; - ldo->regulator = regulator_register(&ldo->desc, &config); + ldo->regulator = devm_regulator_register(&pdev->dev, &ldo->desc, + &config); if (IS_ERR(ldo->regulator)) { ret = PTR_ERR(ldo->regulator); dev_err(wm831x->dev, "Failed to register LDO%d: %d\n", @@ -679,18 +656,8 @@ err: return ret; } -static int wm831x_alive_ldo_remove(struct platform_device *pdev) -{ - struct wm831x_ldo *ldo = platform_get_drvdata(pdev); - - regulator_unregister(ldo->regulator); - - return 0; -} - static struct platform_driver wm831x_alive_ldo_driver = { .probe = wm831x_alive_ldo_probe, - .remove = wm831x_alive_ldo_remove, .driver = { .name = "wm831x-alive-ldo", .owner = THIS_MODULE, |