Commit afadb8e0 authored by Mark Brown's avatar Mark Brown Committed by Dmitry Torokhov

Input: wm831x-on - convert to use genirq

Now that the WM831x core has been converted to use genirq for the
interrupt controller there is no need for the client drivers to
use a WM831x-specific API rather than just calling genirq directly.

Also fixes a leak of the IRQ during init failure - the error path
free_irq() was using NULL rather than the driver data as the data
pointer so free_irq() wouldn't have matched.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent fdba2bb1
...@@ -97,8 +97,9 @@ static int __devinit wm831x_on_probe(struct platform_device *pdev) ...@@ -97,8 +97,9 @@ static int __devinit wm831x_on_probe(struct platform_device *pdev)
wm831x_on->dev->phys = "wm831x_on/input0"; wm831x_on->dev->phys = "wm831x_on/input0";
wm831x_on->dev->dev.parent = &pdev->dev; wm831x_on->dev->dev.parent = &pdev->dev;
ret = wm831x_request_irq(wm831x, irq, wm831x_on_irq, ret = request_threaded_irq(irq, NULL, wm831x_on_irq,
IRQF_TRIGGER_RISING, "wm831x_on", wm831x_on); IRQF_TRIGGER_RISING, "wm831x_on",
wm831x_on);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, "Unable to request IRQ: %d\n", ret); dev_err(&pdev->dev, "Unable to request IRQ: %d\n", ret);
goto err_input_dev; goto err_input_dev;
...@@ -114,7 +115,7 @@ static int __devinit wm831x_on_probe(struct platform_device *pdev) ...@@ -114,7 +115,7 @@ static int __devinit wm831x_on_probe(struct platform_device *pdev)
return 0; return 0;
err_irq: err_irq:
wm831x_free_irq(wm831x, irq, NULL); free_irq(irq, wm831x_on);
err_input_dev: err_input_dev:
input_free_device(wm831x_on->dev); input_free_device(wm831x_on->dev);
err: err:
...@@ -127,7 +128,7 @@ static int __devexit wm831x_on_remove(struct platform_device *pdev) ...@@ -127,7 +128,7 @@ static int __devexit wm831x_on_remove(struct platform_device *pdev)
struct wm831x_on *wm831x_on = platform_get_drvdata(pdev); struct wm831x_on *wm831x_on = platform_get_drvdata(pdev);
int irq = platform_get_irq(pdev, 0); int irq = platform_get_irq(pdev, 0);
wm831x_free_irq(wm831x_on->wm831x, irq, wm831x_on); free_irq(irq, wm831x_on);
cancel_delayed_work_sync(&wm831x_on->work); cancel_delayed_work_sync(&wm831x_on->work);
input_unregister_device(wm831x_on->dev); input_unregister_device(wm831x_on->dev);
kfree(wm831x_on); kfree(wm831x_on);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment