linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: stm32: manage the get_irq probe defer case
@ 2019-04-24 12:26 Fabien Dessenne
  2019-04-24 14:51 ` Amelie DELAUNAY
  2019-04-24 15:56 ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Fabien Dessenne @ 2019-04-24 12:26 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue, Amelie Delaunay, linux-rtc, linux-stm32,
	linux-arm-kernel, linux-kernel
  Cc: Fabien Dessenne

Manage the -EPROBE_DEFER error case for the wake IRQ.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
---
 drivers/rtc/rtc-stm32.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c
index c5908cf..8e6c9b3 100644
--- a/drivers/rtc/rtc-stm32.c
+++ b/drivers/rtc/rtc-stm32.c
@@ -788,11 +788,14 @@ static int stm32_rtc_probe(struct platform_device *pdev)
 	ret = device_init_wakeup(&pdev->dev, true);
 	if (rtc->data->has_wakeirq) {
 		rtc->wakeirq_alarm = platform_get_irq(pdev, 1);
-		if (rtc->wakeirq_alarm <= 0)
-			ret = rtc->wakeirq_alarm;
-		else
+		if (rtc->wakeirq_alarm > 0) {
 			ret = dev_pm_set_dedicated_wake_irq(&pdev->dev,
 							    rtc->wakeirq_alarm);
+		} else {
+			ret = rtc->wakeirq_alarm;
+			if (rtc->wakeirq_alarm == -EPROBE_DEFER)
+				goto err;
+		}
 	}
 	if (ret)
 		dev_warn(&pdev->dev, "alarm can't wake up the system: %d", ret);
-- 
2.7.4


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

* Re: [PATCH] rtc: stm32: manage the get_irq probe defer case
  2019-04-24 12:26 [PATCH] rtc: stm32: manage the get_irq probe defer case Fabien Dessenne
@ 2019-04-24 14:51 ` Amelie DELAUNAY
  2019-04-24 15:56 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Amelie DELAUNAY @ 2019-04-24 14:51 UTC (permalink / raw)
  To: Fabien DESSENNE, Alessandro Zummo, Alexandre Belloni,
	Maxime Coquelin, Alexandre TORGUE, linux-rtc, linux-stm32,
	linux-arm-kernel, linux-kernel

On 4/24/19 2:26 PM, Fabien Dessenne wrote:
> Manage the -EPROBE_DEFER error case for the wake IRQ.
> 
> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>

Acked-by: Amelie Delaunay <amelie.delaunay@st.com>

> ---
>   drivers/rtc/rtc-stm32.c | 9 ++++++---
>   1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c
> index c5908cf..8e6c9b3 100644
> --- a/drivers/rtc/rtc-stm32.c
> +++ b/drivers/rtc/rtc-stm32.c
> @@ -788,11 +788,14 @@ static int stm32_rtc_probe(struct platform_device *pdev)
>   	ret = device_init_wakeup(&pdev->dev, true);
>   	if (rtc->data->has_wakeirq) {
>   		rtc->wakeirq_alarm = platform_get_irq(pdev, 1);
> -		if (rtc->wakeirq_alarm <= 0)
> -			ret = rtc->wakeirq_alarm;
> -		else
> +		if (rtc->wakeirq_alarm > 0) {
>   			ret = dev_pm_set_dedicated_wake_irq(&pdev->dev,
>   							    rtc->wakeirq_alarm);
> +		} else {
> +			ret = rtc->wakeirq_alarm;
> +			if (rtc->wakeirq_alarm == -EPROBE_DEFER)
> +				goto err;
> +		}
>   	}
>   	if (ret)
>   		dev_warn(&pdev->dev, "alarm can't wake up the system: %d", ret);
> 

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

* Re: [PATCH] rtc: stm32: manage the get_irq probe defer case
  2019-04-24 12:26 [PATCH] rtc: stm32: manage the get_irq probe defer case Fabien Dessenne
  2019-04-24 14:51 ` Amelie DELAUNAY
@ 2019-04-24 15:56 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2019-04-24 15:56 UTC (permalink / raw)
  To: Fabien Dessenne
  Cc: Alessandro Zummo, Maxime Coquelin, Alexandre Torgue,
	Amelie Delaunay, linux-rtc, linux-stm32, linux-arm-kernel,
	linux-kernel

On 24/04/2019 14:26:48+0200, Fabien Dessenne wrote:
> Manage the -EPROBE_DEFER error case for the wake IRQ.
> 
> Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
> ---
>  drivers/rtc/rtc-stm32.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
Applied, thanks.

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

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

end of thread, other threads:[~2019-04-24 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24 12:26 [PATCH] rtc: stm32: manage the get_irq probe defer case Fabien Dessenne
2019-04-24 14:51 ` Amelie DELAUNAY
2019-04-24 15:56 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).