rtc: tegra: Propagate errors from platform_get_irq()
authorThierry Reding <treding@nvidia.com>
Fri, 21 Sep 2018 10:12:09 +0000 (12:12 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 16 Oct 2018 10:56:56 +0000 (12:56 +0200)
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>
drivers/rtc/rtc-tegra.c

index 8dc48fe..c9e77a8 100644 (file)
@@ -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))