aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-02-20 04:27:21 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2013-04-08 11:25:18 -0400
commit85529575b67c318e296ae183cc80617d79aea23b (patch)
tree5d392764c2105dec52a3933c8d8df4a5d204c446 /drivers/mfd
parentc6cc25fda58da8685ecef3f179adc7b99c8253b2 (diff)
mfd: 88pm860x: Drop devm_kfree of devm_kzalloc'd data
devm_kfree() allocates memory that is released when a driver detaches. Thus, there is no reason to explicitly call devm_kfree() in probe or remove functions. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/88pm860x-core.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index 893fc1ba6ead..31ca55548ef9 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -1144,17 +1144,15 @@ static int pm860x_probe(struct i2c_client *client,
1144 return -ENOMEM; 1144 return -ENOMEM;
1145 ret = pm860x_dt_init(node, &client->dev, pdata); 1145 ret = pm860x_dt_init(node, &client->dev, pdata);
1146 if (ret) 1146 if (ret)
1147 goto err; 1147 return ret;
1148 } else if (!pdata) { 1148 } else if (!pdata) {
1149 pr_info("No platform data in %s!\n", __func__); 1149 pr_info("No platform data in %s!\n", __func__);
1150 return -EINVAL; 1150 return -EINVAL;
1151 } 1151 }
1152 1152
1153 chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL); 1153 chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL);
1154 if (chip == NULL) { 1154 if (chip == NULL)
1155 ret = -ENOMEM; 1155 return -ENOMEM;
1156 goto err;
1157 }
1158 1156
1159 chip->id = verify_addr(client); 1157 chip->id = verify_addr(client);
1160 chip->regmap = regmap_init_i2c(client, &pm860x_regmap_config); 1158 chip->regmap = regmap_init_i2c(client, &pm860x_regmap_config);
@@ -1194,10 +1192,6 @@ static int pm860x_probe(struct i2c_client *client,
1194 1192
1195 pm860x_device_init(chip, pdata); 1193 pm860x_device_init(chip, pdata);
1196 return 0; 1194 return 0;
1197err:
1198 if (node)
1199 devm_kfree(&client->dev, pdata);
1200 return ret;
1201} 1195}
1202 1196
1203static int pm860x_remove(struct i2c_client *client) 1197static int pm860x_remove(struct i2c_client *client)