diff options
author | Mark Brown <broonie@linaro.org> | 2013-08-31 10:59:57 (GMT) |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-16 23:27:54 (GMT) |
commit | af151ded1b4b22dbedd8cb1600fcaf72e3eaf31e (patch) | |
tree | 1faf4c28556ed4c5719aba8e3b03fed0db98d267 | |
parent | d73b4cb7b3632ccd726746e9cb43002f1adf7956 (diff) | |
download | linux-af151ded1b4b22dbedd8cb1600fcaf72e3eaf31e.tar.xz |
regulator: wm831x-isink: Convert to devm_regulator_register()
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | drivers/regulator/wm831x-isink.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c index 841cb52..0339b88 100644 --- a/drivers/regulator/wm831x-isink.c +++ b/drivers/regulator/wm831x-isink.c @@ -194,7 +194,8 @@ static int wm831x_isink_probe(struct platform_device *pdev) config.init_data = pdata->isink[id]; config.driver_data = isink; - isink->regulator = regulator_register(&isink->desc, &config); + isink->regulator = devm_regulator_register(&pdev->dev, &isink->desc, + &config); if (IS_ERR(isink->regulator)) { ret = PTR_ERR(isink->regulator); dev_err(wm831x->dev, "Failed to register ISINK%d: %d\n", @@ -210,31 +211,19 @@ static int wm831x_isink_probe(struct platform_device *pdev) if (ret != 0) { dev_err(&pdev->dev, "Failed to request ISINK IRQ %d: %d\n", irq, ret); - goto err_regulator; + goto err; } platform_set_drvdata(pdev, isink); return 0; -err_regulator: - regulator_unregister(isink->regulator); err: return ret; } -static int wm831x_isink_remove(struct platform_device *pdev) -{ - struct wm831x_isink *isink = platform_get_drvdata(pdev); - - regulator_unregister(isink->regulator); - - return 0; -} - static struct platform_driver wm831x_isink_driver = { .probe = wm831x_isink_probe, - .remove = wm831x_isink_remove, .driver = { .name = "wm831x-isink", .owner = THIS_MODULE, |