Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jingoo Han and committed by
Lee Jones
bba07827 eac1dcbd

+1 -5
+1 -5
drivers/mfd/wl1273-core.c
··· 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 } ··· 200 203 return -EINVAL; 201 204 } 202 205 203 - core = kzalloc(sizeof(*core), GFP_KERNEL); 206 + core = devm_kzalloc(&client->dev, sizeof(*core), GFP_KERNEL); 204 207 if (!core) 205 208 return -ENOMEM; 206 209 ··· 246 249 247 250 err: 248 251 pdata->free_resources(); 249 - kfree(core); 250 252 251 253 dev_dbg(&client->dev, "%s\n", __func__); 252 254