Commit ef6bd5a3 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: isl6271a-regulator: Use devm_kzalloc()

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 276909d3
...@@ -148,7 +148,7 @@ static int __devinit isl6271a_probe(struct i2c_client *i2c, ...@@ -148,7 +148,7 @@ static int __devinit isl6271a_probe(struct i2c_client *i2c,
if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -EIO; return -EIO;
pmic = kzalloc(sizeof(struct isl_pmic), GFP_KERNEL); pmic = devm_kzalloc(&i2c->dev, sizeof(struct isl_pmic), GFP_KERNEL);
if (!pmic) if (!pmic)
return -ENOMEM; return -ENOMEM;
...@@ -179,8 +179,6 @@ static int __devinit isl6271a_probe(struct i2c_client *i2c, ...@@ -179,8 +179,6 @@ static int __devinit isl6271a_probe(struct i2c_client *i2c,
error: error:
while (--i >= 0) while (--i >= 0)
regulator_unregister(pmic->rdev[i]); regulator_unregister(pmic->rdev[i]);
kfree(pmic);
return err; return err;
} }
...@@ -191,9 +189,6 @@ static int __devexit isl6271a_remove(struct i2c_client *i2c) ...@@ -191,9 +189,6 @@ static int __devexit isl6271a_remove(struct i2c_client *i2c)
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
regulator_unregister(pmic->rdev[i]); regulator_unregister(pmic->rdev[i]);
kfree(pmic);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment