Using platform_get_irq_byname() to retrieve the IRQ number
returns the VIRQ number rather than the local IRQ number for
the device. Passing that value then into regmap_irq_get_virq()
causes a failure because the function is expecting the local
IRQ number (e.g. 0, 1, 2, 3, etc). This patch removes use of
platform_get_irq_byname() and uses the local IRQ number instead.

Signed-off-by: Adam Thomson <[email protected]>
---
 drivers/input/misc/da9055_onkey.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/drivers/input/misc/da9055_onkey.c 
b/drivers/input/misc/da9055_onkey.c
index 4b11ede..4842c6c 100644
--- a/drivers/input/misc/da9055_onkey.c
+++ b/drivers/input/misc/da9055_onkey.c
@@ -79,13 +79,6 @@ static int da9055_onkey_probe(struct platform_device *pdev)
        struct input_dev *input_dev;
        int irq, err;

-       irq = platform_get_irq_byname(pdev, "ONKEY");
-       if (irq < 0) {
-               dev_err(&pdev->dev,
-                       "Failed to get an IRQ for input device, %d\n", irq);
-               return -EINVAL;
-       }
-
        onkey = devm_kzalloc(&pdev->dev, sizeof(*onkey), GFP_KERNEL);
        if (!onkey) {
                dev_err(&pdev->dev, "Failed to allocate memory\n");
@@ -109,7 +102,7 @@ static int da9055_onkey_probe(struct platform_device *pdev)

        INIT_DELAYED_WORK(&onkey->work, da9055_onkey_work);

-       irq = regmap_irq_get_virq(da9055->irq_data, irq);
+       irq = regmap_irq_get_virq(da9055->irq_data, DA9055_IRQ_NONKEY);
        err = request_threaded_irq(irq, NULL, da9055_onkey_irq,
                                   IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
                                   "ONKEY", onkey);
--
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to