mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 09:13:20 -05:00
mfd: max8925: Convert to managed resources for allocating memory
Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
742413a48f
commit
02c7d84894
1 changed files with 2 additions and 2 deletions
|
@ -170,7 +170,8 @@ static int max8925_probe(struct i2c_client *client,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
chip = kzalloc(sizeof(struct max8925_chip), GFP_KERNEL);
|
||||
chip = devm_kzalloc(&client->dev,
|
||||
sizeof(struct max8925_chip), GFP_KERNEL);
|
||||
if (chip == NULL)
|
||||
return -ENOMEM;
|
||||
chip->i2c = client;
|
||||
|
@ -199,7 +200,6 @@ static int max8925_remove(struct i2c_client *client)
|
|||
max8925_device_exit(chip);
|
||||
i2c_unregister_device(chip->adc);
|
||||
i2c_unregister_device(chip->rtc);
|
||||
kfree(chip);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue