dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Axel Lin 2012-03-27 10:09:42 +08:00 committed by Mark Brown
parent 935c14a216
commit 0df8c96fa1
1 changed files with 1 additions and 4 deletions

View File

@ -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;
}