summaryrefslogtreecommitdiff
path: root/drivers/regulator/isl6271a-regulator.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-04-11 19:05:49 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-13 12:59:39 +0400
commitef6bd5a3f128254bee0b9052f3813ca3c3c82fb5 (patch)
treed70988534f3d526db7c43eb9c207f4c4af2b2ab6 /drivers/regulator/isl6271a-regulator.c
parent276909d3599987a0ba44e1b984fde20323ff2aea (diff)
downloadlinux-ef6bd5a3f128254bee0b9052f3813ca3c3c82fb5.tar.xz
regulator: isl6271a-regulator: Use devm_kzalloc()
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/isl6271a-regulator.c')
-rw-r--r--drivers/regulator/isl6271a-regulator.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/regulator/isl6271a-regulator.c b/drivers/regulator/isl6271a-regulator.c
index 863f45a18c30..60044c362eb5 100644
--- a/drivers/regulator/isl6271a-regulator.c
+++ b/drivers/regulator/isl6271a-regulator.c
@@ -148,7 +148,7 @@ static int __devinit isl6271a_probe(struct i2c_client *i2c,
if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -EIO;
- pmic = kzalloc(sizeof(struct isl_pmic), GFP_KERNEL);
+ pmic = devm_kzalloc(&i2c->dev, sizeof(struct isl_pmic), GFP_KERNEL);
if (!pmic)
return -ENOMEM;
@@ -179,8 +179,6 @@ static int __devinit isl6271a_probe(struct i2c_client *i2c,
error:
while (--i >= 0)
regulator_unregister(pmic->rdev[i]);
-
- kfree(pmic);
return err;
}
@@ -191,9 +189,6 @@ static int __devexit isl6271a_remove(struct i2c_client *i2c)
for (i = 0; i < 3; i++)
regulator_unregister(pmic->rdev[i]);
-
- kfree(pmic);
-
return 0;
}