aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/wm831x-on.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/misc/wm831x-on.c')
-rw-r--r--drivers/input/misc/wm831x-on.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/input/misc/wm831x-on.c b/drivers/input/misc/wm831x-on.c
index 6790a812a1d..fa8b3900d98 100644
--- a/drivers/input/misc/wm831x-on.c
+++ b/drivers/input/misc/wm831x-on.c
@@ -76,7 +76,8 @@ static int __devinit wm831x_on_probe(struct platform_device *pdev)
76 int irq = wm831x_irq(wm831x, platform_get_irq(pdev, 0)); 76 int irq = wm831x_irq(wm831x, platform_get_irq(pdev, 0));
77 int ret; 77 int ret;
78 78
79 wm831x_on = kzalloc(sizeof(struct wm831x_on), GFP_KERNEL); 79 wm831x_on = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_on),
80 GFP_KERNEL);
80 if (!wm831x_on) { 81 if (!wm831x_on) {
81 dev_err(&pdev->dev, "Can't allocate data\n"); 82 dev_err(&pdev->dev, "Can't allocate data\n");
82 return -ENOMEM; 83 return -ENOMEM;
@@ -120,7 +121,6 @@ err_irq:
120err_input_dev: 121err_input_dev:
121 input_free_device(wm831x_on->dev); 122 input_free_device(wm831x_on->dev);
122err: 123err:
123 kfree(wm831x_on);
124 return ret; 124 return ret;
125} 125}
126 126
@@ -132,7 +132,6 @@ static int __devexit wm831x_on_remove(struct platform_device *pdev)
132 free_irq(irq, wm831x_on); 132 free_irq(irq, wm831x_on);
133 cancel_delayed_work_sync(&wm831x_on->work); 133 cancel_delayed_work_sync(&wm831x_on->work);
134 input_unregister_device(wm831x_on->dev); 134 input_unregister_device(wm831x_on->dev);
135 kfree(wm831x_on);
136 135
137 return 0; 136 return 0;
138} 137}