Merge remote-tracking branch 'regulator/topic/linear' into regulator-next
[deliverable/linux.git] / drivers / regulator / as3711-regulator.c
index f8524f988bdc810365468f5a65f290d89015baa4..c77a58478cca6b11ffd2c5a69990eddda1900230 100644 (file)
@@ -266,33 +266,16 @@ static int as3711_regulator_probe(struct platform_device *pdev)
                config.regmap = as3711->regmap;
                config.of_node = of_node[id];
 
-               rdev = regulator_register(&ri->desc, &config);
+               rdev = devm_regulator_register(&pdev->dev, &ri->desc, &config);
                if (IS_ERR(rdev)) {
                        dev_err(&pdev->dev, "Failed to register regulator %s\n",
                                ri->desc.name);
-                       ret = PTR_ERR(rdev);
-                       goto eregreg;
+                       return PTR_ERR(rdev);
                }
                reg->rdev = rdev;
        }
        platform_set_drvdata(pdev, regs);
        return 0;
-
-eregreg:
-       while (--id >= 0)
-               regulator_unregister(regs[id].rdev);
-
-       return ret;
-}
-
-static int as3711_regulator_remove(struct platform_device *pdev)
-{
-       struct as3711_regulator *regs = platform_get_drvdata(pdev);
-       int id;
-
-       for (id = 0; id < AS3711_REGULATOR_NUM; ++id)
-               regulator_unregister(regs[id].rdev);
-       return 0;
 }
 
 static struct platform_driver as3711_regulator_driver = {
@@ -301,7 +284,6 @@ static struct platform_driver as3711_regulator_driver = {
                .owner  = THIS_MODULE,
        },
        .probe          = as3711_regulator_probe,
-       .remove         = as3711_regulator_remove,
 };
 
 static int __init as3711_regulator_init(void)
This page took 0.025463 seconds and 5 git commands to generate.