[2/2] gpio: tegra: Use platform_get_irq()

Message ID 20170720160057.13483-2-thierry.reding@gmail.com
State Accepted
Headers show

Commit Message

Thierry Reding July 20, 2017, 4 p.m.
From: Thierry Reding <treding@nvidia.com>

Instead of using platform_get_resource() and getting the interrupts from
the resource, use platform_get_irq() which is slightly easier to use and
covers some special cases that the former doesn't.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/gpio/gpio-tegra.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Linus Walleij Aug. 2, 2017, 12:03 p.m. | #1
On Thu, Jul 20, 2017 at 6:00 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:

> From: Thierry Reding <treding@nvidia.com>
>
> Instead of using platform_get_resource() and getting the interrupts from
> the resource, use platform_get_irq() which is slightly easier to use and
> covers some special cases that the former doesn't.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index cdbff018a0f4..17725c83821f 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -640,15 +640,15 @@  static int tegra_gpio_probe(struct platform_device *pdev)
 		return -ENODEV;
 
 	for (i = 0; i < tgi->bank_count; i++) {
-		res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
-		if (!res) {
-			dev_err(&pdev->dev, "Missing IRQ resource\n");
-			return -ENODEV;
+		ret = platform_get_irq(pdev, i);
+		if (ret < 0) {
+			dev_err(&pdev->dev, "Missing IRQ resource: %d\n", ret);
+			return ret;
 		}
 
 		bank = &tgi->bank_info[i];
 		bank->bank = i;
-		bank->irq = res->start;
+		bank->irq = ret;
 		bank->tgi = tgi;
 	}