staging/nvec: Use platform_get_irq()
authorThierry Reding <treding@nvidia.com>
Tue, 29 Jul 2014 11:16:15 +0000 (13:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jul 2014 00:18:47 +0000 (17:18 -0700)
As opposed to platform_get_resource(), the platform_get_irq() function
has special code to handle driver probe deferral when booting using DT
and where an interrupt provider hasn't been registered yet. While this
is unlikely to become an issue for nvec, platform_get_irq() is the
recommended way to get at interrupts.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/nvec/nvec.c

index 815065837ce737e3a4c2d53b8d78db05cae6e6a4..a93208adbfcf2a584621e694b64cd7be9123d53e 100644 (file)
@@ -821,8 +821,8 @@ static int tegra_nvec_probe(struct platform_device *pdev)
        if (IS_ERR(base))
                return PTR_ERR(base);
 
-       res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
-       if (!res) {
+       nvec->irq = platform_get_irq(pdev, 0);
+       if (nvec->irq < 0) {
                dev_err(&pdev->dev, "no irq resource?\n");
                return -ENODEV;
        }
@@ -840,7 +840,6 @@ static int tegra_nvec_probe(struct platform_device *pdev)
        }
 
        nvec->base = base;
-       nvec->irq = res->start;
        nvec->i2c_clk = i2c_clk;
        nvec->rx = &nvec->msg_pool[0];