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

gpio: tegra: Use platform_get_irq()

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: NThierry Reding <treding@nvidia.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 56420903
...@@ -641,15 +641,15 @@ static int tegra_gpio_probe(struct platform_device *pdev) ...@@ -641,15 +641,15 @@ static int tegra_gpio_probe(struct platform_device *pdev)
return -ENODEV; return -ENODEV;
for (i = 0; i < tgi->bank_count; i++) { for (i = 0; i < tgi->bank_count; i++) {
res = platform_get_resource(pdev, IORESOURCE_IRQ, i); ret = platform_get_irq(pdev, i);
if (!res) { if (ret < 0) {
dev_err(&pdev->dev, "Missing IRQ resource\n"); dev_err(&pdev->dev, "Missing IRQ resource: %d\n", ret);
return -ENODEV; return ret;
} }
bank = &tgi->bank_info[i]; bank = &tgi->bank_info[i];
bank->bank = i; bank->bank = i;
bank->irq = res->start; bank->irq = ret;
bank->tgi = tgi; bank->tgi = tgi;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册