All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc: tegra: Propagate errors from platform_get_irq()
@ 2018-09-21 10:12 Thierry Reding
  2018-10-16 10:58 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Thierry Reding @ 2018-09-21 10:12 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni
  Cc: Jonathan Hunter, linux-rtc, linux-tegra, linux-kernel

From: Thierry Reding <treding@nvidia.com>

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>
---
 drivers/rtc/rtc-tegra.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c
index 8dc48fe7fc35..c9e77a83cd1b 100644
--- a/drivers/rtc/rtc-tegra.c
+++ b/drivers/rtc/rtc-tegra.c
@@ -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))
-- 
2.19.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtc: tegra: Propagate errors from platform_get_irq()
  2018-09-21 10:12 [PATCH] rtc: tegra: Propagate errors from platform_get_irq() Thierry Reding
@ 2018-10-16 10:58 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2018-10-16 10:58 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Alessandro Zummo, Jonathan Hunter, linux-rtc, linux-tegra, linux-kernel

On 21/09/2018 12:12:09+0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> 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>
> ---
>  drivers/rtc/rtc-tegra.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
Applied, thanks.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-16 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-21 10:12 [PATCH] rtc: tegra: Propagate errors from platform_get_irq() Thierry Reding
2018-10-16 10:58 ` Alexandre Belloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.