Skip to content

Commit

Permalink
mfd: wl1273: Use devm_*() functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jingoo Han authored and Lee Jones committed Aug 20, 2013
1 parent eac1dcb commit bba0782
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/mfd/wl1273-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
struct wl1273_core *core = i2c_get_clientdata(client);

dev_dbg(&client->dev, "%s\n", __func__);

mfd_remove_devices(&client->dev);
kfree(core);

return 0;
}
Expand All @@ -203,7 +200,7 @@ static int wl1273_core_probe(struct i2c_client *client,
return -EINVAL;
}

core = kzalloc(sizeof(*core), GFP_KERNEL);
core = devm_kzalloc(&client->dev, sizeof(*core), GFP_KERNEL);
if (!core)
return -ENOMEM;

Expand Down Expand Up @@ -249,7 +246,6 @@ static int wl1273_core_probe(struct i2c_client *client,

err:
pdata->free_resources();
kfree(core);

dev_dbg(&client->dev, "%s\n", __func__);

Expand Down

0 comments on commit bba0782

Please sign in to comment.