aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/wm831x-ts.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/wm831x-ts.c')
-rw-r--r--drivers/input/touchscreen/wm831x-ts.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c
index 52abb98a8ae..f88fab56178 100644
--- a/drivers/input/touchscreen/wm831x-ts.c
+++ b/drivers/input/touchscreen/wm831x-ts.c
@@ -233,7 +233,7 @@ static void wm831x_ts_input_close(struct input_dev *idev)
233 } 233 }
234} 234}
235 235
236static __devinit int wm831x_ts_probe(struct platform_device *pdev) 236static int wm831x_ts_probe(struct platform_device *pdev)
237{ 237{
238 struct wm831x_ts *wm831x_ts; 238 struct wm831x_ts *wm831x_ts;
239 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); 239 struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent);
@@ -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,21 +377,18 @@ 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}
383 383
384static __devexit int wm831x_ts_remove(struct platform_device *pdev) 384static int wm831x_ts_remove(struct platform_device *pdev)
385{ 385{
386 struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev); 386 struct wm831x_ts *wm831x_ts = platform_get_drvdata(pdev);
387 387
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 platform_set_drvdata(pdev, NULL);
394 return 0; 392 return 0;
395} 393}
396 394
@@ -400,7 +398,7 @@ static struct platform_driver wm831x_ts_driver = {
400 .owner = THIS_MODULE, 398 .owner = THIS_MODULE,
401 }, 399 },
402 .probe = wm831x_ts_probe, 400 .probe = wm831x_ts_probe,
403 .remove = __devexit_p(wm831x_ts_remove), 401 .remove = wm831x_ts_remove,
404}; 402};
405module_platform_driver(wm831x_ts_driver); 403module_platform_driver(wm831x_ts_driver);
406 404