Commit 85529575 authored by Jingoo Han's avatar Jingoo Han Committed by Samuel Ortiz

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: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent c6cc25fd
...@@ -1144,17 +1144,15 @@ static int pm860x_probe(struct i2c_client *client, ...@@ -1144,17 +1144,15 @@ static int pm860x_probe(struct i2c_client *client,
return -ENOMEM; return -ENOMEM;
ret = pm860x_dt_init(node, &client->dev, pdata); ret = pm860x_dt_init(node, &client->dev, pdata);
if (ret) if (ret)
goto err; return ret;
} else if (!pdata) { } else if (!pdata) {
pr_info("No platform data in %s!\n", __func__); pr_info("No platform data in %s!\n", __func__);
return -EINVAL; return -EINVAL;
} }
chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL); chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL);
if (chip == NULL) { if (chip == NULL)
ret = -ENOMEM; return -ENOMEM;
goto err;
}
chip->id = verify_addr(client); chip->id = verify_addr(client);
chip->regmap = regmap_init_i2c(client, &pm860x_regmap_config); chip->regmap = regmap_init_i2c(client, &pm860x_regmap_config);
...@@ -1194,10 +1192,6 @@ static int pm860x_probe(struct i2c_client *client, ...@@ -1194,10 +1192,6 @@ static int pm860x_probe(struct i2c_client *client,
pm860x_device_init(chip, pdata); pm860x_device_init(chip, pdata);
return 0; return 0;
err:
if (node)
devm_kfree(&client->dev, pdata);
return ret;
} }
static int pm860x_remove(struct i2c_client *client) static int pm860x_remove(struct i2c_client *client)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment