diff options
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/88pm860x-core.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c index 629d6404cab4..eeb481d426b5 100644 --- a/drivers/mfd/88pm860x-core.c +++ b/drivers/mfd/88pm860x-core.c | |||
@@ -1150,7 +1150,8 @@ static int pm860x_probe(struct i2c_client *client, | |||
1150 | return -EINVAL; | 1150 | return -EINVAL; |
1151 | } | 1151 | } |
1152 | 1152 | ||
1153 | chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL); | 1153 | chip = devm_kzalloc(&client->dev, |
1154 | sizeof(struct pm860x_chip), GFP_KERNEL); | ||
1154 | if (chip == NULL) | 1155 | if (chip == NULL) |
1155 | return -ENOMEM; | 1156 | return -ENOMEM; |
1156 | 1157 | ||
@@ -1160,7 +1161,6 @@ static int pm860x_probe(struct i2c_client *client, | |||
1160 | ret = PTR_ERR(chip->regmap); | 1161 | ret = PTR_ERR(chip->regmap); |
1161 | dev_err(&client->dev, "Failed to allocate register map: %d\n", | 1162 | dev_err(&client->dev, "Failed to allocate register map: %d\n", |
1162 | ret); | 1163 | ret); |
1163 | kfree(chip); | ||
1164 | return ret; | 1164 | return ret; |
1165 | } | 1165 | } |
1166 | chip->client = client; | 1166 | chip->client = client; |
@@ -1203,7 +1203,6 @@ static int pm860x_remove(struct i2c_client *client) | |||
1203 | regmap_exit(chip->regmap_companion); | 1203 | regmap_exit(chip->regmap_companion); |
1204 | i2c_unregister_device(chip->companion); | 1204 | i2c_unregister_device(chip->companion); |
1205 | } | 1205 | } |
1206 | kfree(chip); | ||
1207 | return 0; | 1206 | return 0; |
1208 | } | 1207 | } |
1209 | 1208 | ||