gpio: tegra: Use platform_irq_count()
Subsystems (2)
PATCH 1/2 gpio: tegra: Use platform_irq_count()
From: Thierry Reding <[email protected]>
Use platform_irq_count() instead of open-coding the same code sequence.
--- drivers/gpio/gpio-tegra.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/gpio/gpio-tegra.c +6 -7
@@ -588,13 +588,12 @@ static int tegra_gpio_probe(struct platform_device *pdev) tgi->soc = config; tgi->dev = &pdev->dev; -for (;;) { - res =platform_get_resource (pdev,IORESOURCE_IRQ , - tgi->bank_count); -if (!res) -break ; - tgi->bank_count++; - } + ret =platform_irq_count (pdev); +if (ret <0 ) +return ret; + + tgi->bank_count = ret; +if (!tgi->bank_count) {dev_err (&pdev->dev,"Missing IRQ resource\n" );return -ENODEV ;
Signature · 1 line
2.13.3
PATCH 2/2 gpio: tegra: Use platform_get_irq()
In reply to a message not in the archiveFrom: Thierry Reding <[email protected]>
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.
--- drivers/gpio/gpio-tegra.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpio/gpio-tegra.c +5 -5
@@ -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; }
Signature · 1 line
2.13.3
Quoted 8 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Use
platform_irq_count()instead of open-coding the same code sequence.Signed-off-by Thierry Reding <[email protected]>--- drivers/gpio/gpio-tegra.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
Ping...
Thierry
Quoted 5 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Use
platform_irq_count()instead of open-coding the same code sequence.Signed-off-by Thierry Reding <[email protected]>
Patch applied.
Yours,
Linus Walleij
Re: [PATCH 2/2] gpio: tegra: Use platform_get_irq()
In reply to a message not in the archiveQuoted 7 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Instead of using
platform_get_resource()and getting the interrupts from the resource, useplatform_get_irq()which is slightly easier to use and covers some special cases that the former doesn't.Signed-off-by Thierry Reding <[email protected]>
Patch applied.
Yours,
Linus Walleij