diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-04-11 11:05:49 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-13 04:59:39 -0400 |
commit | ef6bd5a3f128254bee0b9052f3813ca3c3c82fb5 (patch) | |
tree | d70988534f3d526db7c43eb9c207f4c4af2b2ab6 /drivers/regulator/isl6271a-regulator.c | |
parent | 276909d3599987a0ba44e1b984fde20323ff2aea (diff) |
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.c | 7 |
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, | |||
148 | if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 148 | if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
149 | return -EIO; | 149 | return -EIO; |
150 | 150 | ||
151 | pmic = kzalloc(sizeof(struct isl_pmic), GFP_KERNEL); | 151 | pmic = devm_kzalloc(&i2c->dev, sizeof(struct isl_pmic), GFP_KERNEL); |
152 | if (!pmic) | 152 | if (!pmic) |
153 | return -ENOMEM; | 153 | return -ENOMEM; |
154 | 154 | ||
@@ -179,8 +179,6 @@ static int __devinit isl6271a_probe(struct i2c_client *i2c, | |||
179 | error: | 179 | error: |
180 | while (--i >= 0) | 180 | while (--i >= 0) |
181 | regulator_unregister(pmic->rdev[i]); | 181 | regulator_unregister(pmic->rdev[i]); |
182 | |||
183 | kfree(pmic); | ||
184 | return err; | 182 | return err; |
185 | } | 183 | } |
186 | 184 | ||
@@ -191,9 +189,6 @@ static int __devexit isl6271a_remove(struct i2c_client *i2c) | |||
191 | 189 | ||
192 | for (i = 0; i < 3; i++) | 190 | for (i = 0; i < 3; i++) |
193 | regulator_unregister(pmic->rdev[i]); | 191 | regulator_unregister(pmic->rdev[i]); |
194 | |||
195 | kfree(pmic); | ||
196 | |||
197 | return 0; | 192 | return 0; |
198 | } | 193 | } |
199 | 194 | ||