summaryrefslogtreecommitdiff
path: root/drivers/input/misc/wm831x-on.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-10-11 00:42:34 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-10-11 00:49:05 -0700
commitdae6ba4ab797ed411fbde60ef5b5f6fbf13f0090 (patch)
tree90504986794740196728ef835e9bdf0e65678c8f /drivers/input/misc/wm831x-on.c
parentef8dee5cfe4df1091419e7d58b902e7e3d90b00e (diff)
Input: wm831x-on - convert to devm_kzalloc()
Saves a small amount of code and reduces the potential for leaks. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
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 6790a812a1db..fa8b3900d981 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)
int irq = wm831x_irq(wm831x, platform_get_irq(pdev, 0));
int ret;
- wm831x_on = kzalloc(sizeof(struct wm831x_on), GFP_KERNEL);
+ wm831x_on = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_on),
+ GFP_KERNEL);
if (!wm831x_on) {
dev_err(&pdev->dev, "Can't allocate data\n");
return -ENOMEM;
@@ -120,7 +121,6 @@ err_irq:
err_input_dev:
input_free_device(wm831x_on->dev);
err:
- kfree(wm831x_on);
return ret;
}
@@ -132,7 +132,6 @@ static int __devexit wm831x_on_remove(struct platform_device *pdev)
free_irq(irq, wm831x_on);
cancel_delayed_work_sync(&wm831x_on->work);
input_unregister_device(wm831x_on->dev);
- kfree(wm831x_on);
return 0;
}