aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-10-11 03:42:34 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-10-11 03:49:01 -0400
commitef8dee5cfe4df1091419e7d58b902e7e3d90b00e (patch)
tree7983d75a7870f3ee11e2dc4472dc42fe8de9782e /drivers/input
parent2f7badb9742f88e7307d9e823f40c8621ceaa1c4 (diff)
Input: wm831x-ts - convert to devm_kzalloc()
Saves a little code and eliminates the possibility of introducing some leaks. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/wm831x-ts.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c
index ac667e469b35..362f78d4507f 100644
--- a/drivers/input/touchscreen/wm831x-ts.c
+++ b/drivers/input/touchscreen/wm831x-ts.c
@@ -245,7 +245,8 @@ static __devinit int wm831x_ts_probe(struct platform_device *pdev)
245 if (core_pdata) 245 if (core_pdata)
246 pdata = core_pdata->touch; 246 pdata = core_pdata->touch;
247 247
248 wm831x_ts = kzalloc(sizeof(struct wm831x_ts), GFP_KERNEL); 248 wm831x_ts = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_ts),
249 GFP_KERNEL);
249 input_dev = input_allocate_device(); 250 input_dev = input_allocate_device();
250 if (!wm831x_ts || !input_dev) { 251 if (!wm831x_ts || !input_dev) {
251 error = -ENOMEM; 252 error = -ENOMEM;
@@ -376,7 +377,6 @@ err_data_irq:
376 free_irq(wm831x_ts->data_irq, wm831x_ts); 377 free_irq(wm831x_ts->data_irq, wm831x_ts);
377err_alloc: 378err_alloc:
378 input_free_device(input_dev); 379 input_free_device(input_dev);
379 kfree(wm831x_ts);
380 380
381 return error; 381 return error;
382} 382}
@@ -388,7 +388,6 @@ static __devexit int wm831x_ts_remove(struct platform_device *pdev)
388 free_irq(wm831x_ts->pd_irq, wm831x_ts); 388 free_irq(wm831x_ts->pd_irq, wm831x_ts);
389 free_irq(wm831x_ts->data_irq, wm831x_ts); 389 free_irq(wm831x_ts->data_irq, wm831x_ts);
390 input_unregister_device(wm831x_ts->input_dev); 390 input_unregister_device(wm831x_ts->input_dev);
391 kfree(wm831x_ts);
392 391
393 return 0; 392 return 0;
394} 393}