summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/ad5398.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-03-27 10:09:42 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-01 11:59:36 +0100
commit0df8c96fa1c1adb23c49124685dde77b6560bef2 (patch)
tree82193e75319334a669ce38bc05a2199aff16b866 /drivers/regulator/ad5398.c
parent935c14a216c1afa855678e200607e98cc8cc2c51 (diff)
downloadlinux-0df8c96fa1c1adb23c49124685dde77b6560bef2.tar.gz
linux-0df8c96fa1c1adb23c49124685dde77b6560bef2.tar.bz2
linux-0df8c96fa1c1adb23c49124685dde77b6560bef2.zip
regulator: ad5398: Use devm_kzalloc
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/ad5398.c')
-rw-r--r--drivers/regulator/ad5398.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/regulator/ad5398.c b/drivers/regulator/ad5398.c
index ed587987f445..7d51793a072a 100644
--- a/drivers/regulator/ad5398.c
+++ b/drivers/regulator/ad5398.c
@@ -220,7 +220,7 @@ static int __devinit ad5398_probe(struct i2c_client *client,
if (!init_data)
return -EINVAL;
- chip = kzalloc(sizeof(*chip), GFP_KERNEL);
+ chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
@@ -246,7 +246,6 @@ static int __devinit ad5398_probe(struct i2c_client *client,
return 0;
err:
- kfree(chip);
return ret;
}
@@ -255,8 +254,6 @@ static int __devexit ad5398_remove(struct i2c_client *client)
struct ad5398_chip_info *chip = i2c_get_clientdata(client);
regulator_unregister(chip->rdev);
- kfree(chip);
-
return 0;
}