summaryrefslogtreecommitdiff
path: root/drivers/regulator/twl-regulator.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-06-16 05:44:20 +0400
committerMark Brown <broonie@linaro.org>2014-06-27 15:50:35 +0400
commitcd01e32d91db5e7d549671ffbb747c4639eb8c72 (patch)
tree24d43293a3243eb411f8d0b082a9bb9e0f6ac7fa /drivers/regulator/twl-regulator.c
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
downloadlinux-cd01e32d91db5e7d549671ffbb747c4639eb8c72.tar.xz
regulator: twl: Convert to use devm_kmemdup()
Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/twl-regulator.c')
-rw-r--r--drivers/regulator/twl-regulator.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index fed28abef419..0b4f8660fdb4 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -1128,7 +1128,7 @@ static int twlreg_probe(struct platform_device *pdev)
if (!initdata)
return -EINVAL;
- info = kmemdup(template, sizeof(*info), GFP_KERNEL);
+ info = devm_kmemdup(&pdev->dev, template, sizeof(*info), GFP_KERNEL);
if (!info)
return -ENOMEM;
@@ -1192,7 +1192,6 @@ static int twlreg_probe(struct platform_device *pdev)
if (IS_ERR(rdev)) {
dev_err(&pdev->dev, "can't register %s, %ld\n",
info->desc.name, PTR_ERR(rdev));
- kfree(info);
return PTR_ERR(rdev);
}
platform_set_drvdata(pdev, rdev);
@@ -1212,20 +1211,10 @@ static int twlreg_probe(struct platform_device *pdev)
return 0;
}
-static int twlreg_remove(struct platform_device *pdev)
-{
- struct regulator_dev *rdev = platform_get_drvdata(pdev);
- struct twlreg_info *info = rdev->reg_data;
-
- kfree(info);
- return 0;
-}
-
MODULE_ALIAS("platform:twl_reg");
static struct platform_driver twlreg_driver = {
.probe = twlreg_probe,
- .remove = twlreg_remove,
/* NOTE: short name, to work around driver model truncation of
* "twl_regulator.12" (and friends) to "twl_regulator.1".
*/