Commit bba078273e259c7eff729ac00a1476987ad5413a

Authored by Jingoo Han
Committed by Lee Jones
1 parent eac1dcbd3e

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>

Showing 1 changed file with 1 additions and 5 deletions Side-by-side Diff

drivers/mfd/wl1273-core.c
... ... @@ -172,12 +172,9 @@
172 172  
173 173 static int wl1273_core_remove(struct i2c_client *client)
174 174 {
175   - struct wl1273_core *core = i2c_get_clientdata(client);
176   -
177 175 dev_dbg(&client->dev, "%s\n", __func__);
178 176  
179 177 mfd_remove_devices(&client->dev);
180   - kfree(core);
181 178  
182 179 return 0;
183 180 }
... ... @@ -203,7 +200,7 @@
203 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 204 if (!core)
208 205 return -ENOMEM;
209 206  
... ... @@ -249,7 +246,6 @@
249 246  
250 247 err:
251 248 pdata->free_resources();
252   - kfree(core);
253 249  
254 250 dev_dbg(&client->dev, "%s\n", __func__);
255 251