mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
gpio: tegra: Use platform_irq_count()
Use platform_irq_count() instead of open-coding the same code sequence. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
7eb6ce2f27
commit
564209037d
1 changed files with 6 additions and 7 deletions
|
@ -589,13 +589,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;
|
||||
|
|
Loading…
Reference in a new issue