diff options
-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, | |||
170 | return -EINVAL; | 170 | return -EINVAL; |
171 | } | 171 | } |
172 | 172 | ||
173 | chip = kzalloc(sizeof(struct max8925_chip), GFP_KERNEL); | 173 | chip = devm_kzalloc(&client->dev, |
174 | sizeof(struct max8925_chip), GFP_KERNEL); | ||
174 | if (chip == NULL) | 175 | if (chip == NULL) |
175 | return -ENOMEM; | 176 | return -ENOMEM; |
176 | chip->i2c = client; | 177 | chip->i2c = client; |
@@ -199,7 +200,6 @@ static int max8925_remove(struct i2c_client *client) | |||
199 | max8925_device_exit(chip); | 200 | max8925_device_exit(chip); |
200 | i2c_unregister_device(chip->adc); | 201 | i2c_unregister_device(chip->adc); |
201 | i2c_unregister_device(chip->rtc); | 202 | i2c_unregister_device(chip->rtc); |
202 | kfree(chip); | ||
203 | return 0; | 203 | return 0; |
204 | } | 204 | } |
205 | 205 | ||