diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-08-20 03:06:17 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2013-08-20 03:51:58 -0400 |
commit | bba078273e259c7eff729ac00a1476987ad5413a (patch) | |
tree | e59631ae7a1c9828eca48375d68b509beb9dfebb /drivers/mfd | |
parent | eac1dcbd3e211998fb8342902b3acee149a9271d (diff) |
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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/wl1273-core.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/mfd/wl1273-core.c b/drivers/mfd/wl1273-core.c index 1288e9943f01..f7c52d901040 100644 --- a/drivers/mfd/wl1273-core.c +++ b/drivers/mfd/wl1273-core.c | |||
@@ -172,12 +172,9 @@ static int wl1273_fm_set_volume(struct wl1273_core *core, unsigned int volume) | |||
172 | 172 | ||
173 | static int wl1273_core_remove(struct i2c_client *client) | 173 | static int wl1273_core_remove(struct i2c_client *client) |
174 | { | 174 | { |
175 | struct wl1273_core *core = i2c_get_clientdata(client); | ||
176 | |||
177 | dev_dbg(&client->dev, "%s\n", __func__); | 175 | dev_dbg(&client->dev, "%s\n", __func__); |
178 | 176 | ||
179 | mfd_remove_devices(&client->dev); | 177 | mfd_remove_devices(&client->dev); |
180 | kfree(core); | ||
181 | 178 | ||
182 | return 0; | 179 | return 0; |
183 | } | 180 | } |
@@ -203,7 +200,7 @@ static int wl1273_core_probe(struct i2c_client *client, | |||
203 | return -EINVAL; | 200 | return -EINVAL; |
204 | } | 201 | } |
205 | 202 | ||
206 | core = kzalloc(sizeof(*core), GFP_KERNEL); | 203 | core = devm_kzalloc(&client->dev, sizeof(*core), GFP_KERNEL); |
207 | if (!core) | 204 | if (!core) |
208 | return -ENOMEM; | 205 | return -ENOMEM; |
209 | 206 | ||
@@ -249,7 +246,6 @@ static int wl1273_core_probe(struct i2c_client *client, | |||
249 | 246 | ||
250 | err: | 247 | err: |
251 | pdata->free_resources(); | 248 | pdata->free_resources(); |
252 | kfree(core); | ||
253 | 249 | ||
254 | dev_dbg(&client->dev, "%s\n", __func__); | 250 | dev_dbg(&client->dev, "%s\n", __func__); |
255 | 251 | ||