From: Sachin Kamat Date: Wed, 4 Sep 2013 06:30:57 +0000 (+0530) Subject: regulator: anatop-regulator: Use devm_regulator_register X-Git-Tag: firefly_0821_release~176^2~5011^2~23^2~24 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=be1221e893775d8447623475a01f877b902fc8b4;p=firefly-linux-kernel-4.4.55.git regulator: anatop-regulator: Use devm_regulator_register devm_* simplifies the code. Signed-off-by: Sachin Kamat Acked-by: Marek Vasut Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c index 0d4a8ccbb536..e42bfd17562a 100644 --- a/drivers/regulator/anatop-regulator.c +++ b/drivers/regulator/anatop-regulator.c @@ -200,7 +200,7 @@ static int anatop_regulator_probe(struct platform_device *pdev) config.regmap = sreg->anatop; /* register regulator */ - rdev = regulator_register(rdesc, &config); + rdev = devm_regulator_register(dev, rdesc, &config); if (IS_ERR(rdev)) { dev_err(dev, "failed to register %s\n", rdesc->name); @@ -223,7 +223,6 @@ static int anatop_regulator_remove(struct platform_device *pdev) struct anatop_regulator *sreg = rdev_get_drvdata(rdev); const char *name = sreg->name; - regulator_unregister(rdev); kfree(name); return 0;