mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-04 04:06:26 +00:00
mfd: wl1273: Use devm_*() functions
Use devm_*() functions to make cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
parent
eac1dcbd3e
commit
bba078273e
@ -172,12 +172,9 @@ static int wl1273_fm_set_volume(struct wl1273_core *core, unsigned int volume)
|
|||||||
|
|
||||||
static int wl1273_core_remove(struct i2c_client *client)
|
static int wl1273_core_remove(struct i2c_client *client)
|
||||||
{
|
{
|
||||||
struct wl1273_core *core = i2c_get_clientdata(client);
|
|
||||||
|
|
||||||
dev_dbg(&client->dev, "%s\n", __func__);
|
dev_dbg(&client->dev, "%s\n", __func__);
|
||||||
|
|
||||||
mfd_remove_devices(&client->dev);
|
mfd_remove_devices(&client->dev);
|
||||||
kfree(core);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -203,7 +200,7 @@ static int wl1273_core_probe(struct i2c_client *client,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
core = kzalloc(sizeof(*core), GFP_KERNEL);
|
core = devm_kzalloc(&client->dev, sizeof(*core), GFP_KERNEL);
|
||||||
if (!core)
|
if (!core)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
@ -249,7 +246,6 @@ static int wl1273_core_probe(struct i2c_client *client,
|
|||||||
|
|
||||||
err:
|
err:
|
||||||
pdata->free_resources();
|
pdata->free_resources();
|
||||||
kfree(core);
|
|
||||||
|
|
||||||
dev_dbg(&client->dev, "%s\n", __func__);
|
dev_dbg(&client->dev, "%s\n", __func__);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user