Skip to content

Commit

Permalink
rtc: tegra: Propagate errors from platform_get_irq()
Browse files Browse the repository at this point in the history
Instead of confusingly returning -EBUSY on failure to obtain an
interrupt, propagate the real error code. While at it, let the user know
why the interrupt could not be acquired.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
  • Loading branch information
Thierry Reding authored and Alexandre Belloni committed Oct 16, 2018
1 parent bc51098 commit fe0b5ce
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/rtc/rtc-tegra.c
Original file line number Diff line number Diff line change
@@ -322,9 +322,13 @@ static int __init tegra_rtc_probe(struct platform_device *pdev)
if (IS_ERR(info->rtc_base))
return PTR_ERR(info->rtc_base);

info->tegra_rtc_irq = platform_get_irq(pdev, 0);
if (info->tegra_rtc_irq <= 0)
return -EBUSY;
ret = platform_get_irq(pdev, 0);
if (ret <= 0) {
dev_err(&pdev->dev, "failed to get platform IRQ: %d\n", ret);
return ret;
}

info->tegra_rtc_irq = ret;

info->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(info->clk))

0 comments on commit fe0b5ce

Please sign in to comment.