提交 56420903 编写于 作者: T Thierry Reding 提交者: Linus Walleij

gpio: tegra: Use platform_irq_count()

Use platform_irq_count() instead of open-coding the same code sequence.
Signed-off-by: NThierry Reding <treding@nvidia.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 7eb6ce2f
...@@ -589,13 +589,12 @@ static int tegra_gpio_probe(struct platform_device *pdev) ...@@ -589,13 +589,12 @@ static int tegra_gpio_probe(struct platform_device *pdev)
tgi->soc = config; tgi->soc = config;
tgi->dev = &pdev->dev; tgi->dev = &pdev->dev;
for (;;) { ret = platform_irq_count(pdev);
res = platform_get_resource(pdev, IORESOURCE_IRQ, if (ret < 0)
tgi->bank_count); return ret;
if (!res)
break; tgi->bank_count = ret;
tgi->bank_count++;
}
if (!tgi->bank_count) { if (!tgi->bank_count) {
dev_err(&pdev->dev, "Missing IRQ resource\n"); dev_err(&pdev->dev, "Missing IRQ resource\n");
return -ENODEV; return -ENODEV;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册