Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging/nvec: Use platform_get_irq()

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>

authored by

Thierry Reding and committed by
Greg Kroah-Hartman
b5b628ba 47e7b050

+2 -3
+2 -3
drivers/staging/nvec/nvec.c
··· 821 821 if (IS_ERR(base)) 822 822 return PTR_ERR(base); 823 823 824 - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 825 - if (!res) { 824 + nvec->irq = platform_get_irq(pdev, 0); 825 + if (nvec->irq < 0) { 826 826 dev_err(&pdev->dev, "no irq resource?\n"); 827 827 return -ENODEV; 828 828 } ··· 840 840 } 841 841 842 842 nvec->base = base; 843 - nvec->irq = res->start; 844 843 nvec->i2c_clk = i2c_clk; 845 844 nvec->rx = &nvec->msg_pool[0]; 846 845