diff options
author | Lee Jones <lee.jones@linaro.org> | 2013-05-23 11:25:03 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-13 06:13:39 -0400 |
commit | a1ace0aac5a83b859c2ddeb5dfb032b9b6dcd9cf (patch) | |
tree | 847a53eae972d0c337c8da2775c04cbad408c30e /drivers/mfd | |
parent | 02c7d848946d4f62ef9a2bee9de00b37e5941dc1 (diff) |
mfd: 88pm860x: Convert to managed resources for allocating memory
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
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 | ||