diff mbox series

rtc: stm32: manage the get_irq probe defer case

Message ID 1556108808-32722-1-git-send-email-fabien.dessenne@st.com (mailing list archive)
State Mainlined, archived
Commit cf612c5949aca2bd81a1e28688957c8149ea2693
Headers show
Series rtc: stm32: manage the get_irq probe defer case | expand

Commit Message

Fabien DESSENNE April 24, 2019, 12:26 p.m. UTC
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(-)

Comments

Amelie Delaunay April 24, 2019, 2:51 p.m. UTC | #1
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);
>
Alexandre Belloni April 24, 2019, 3:56 p.m. UTC | #2
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.
diff mbox series

Patch

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);