]> git.karo-electronics.de Git - linux-beck.git/commitdiff
regulator: wm831x-isink: Convert to devm_regulator_register()
authorMark Brown <broonie@linaro.org>
Sat, 31 Aug 2013 10:59:57 +0000 (11:59 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 16 Sep 2013 23:27:54 +0000 (00:27 +0100)
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/wm831x-isink.c

index 841cb52b2bb608369b23e9133dbc70b20bfc51a3..0339b886df5dbf2a6bde26111a0a4c6a60f58732 100644 (file)
@@ -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,