diff options
author | Lee Jones <lee.jones@linaro.org> | 2013-05-23 16:25:17 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-13 12:11:45 +0200 |
commit | 02c7d848946d4f62ef9a2bee9de00b37e5941dc1 (patch) | |
tree | 75ed25570bebf7bc3d6ec8c6ae77b5eb86a527c3 /drivers/mfd | |
parent | 742413a48fafad813393e8f5dcb26b8ac2944140 (diff) |
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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/max8925-i2c.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c index 92bbebd31598..8042b3205eaa 100644 --- a/drivers/mfd/max8925-i2c.c +++ b/drivers/mfd/max8925-i2c.c @@ -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; } |