diff options
author | Fabien Dessenne <fabien.dessenne@st.com> | 2019-04-24 08:26:48 -0400 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2019-04-29 09:53:42 -0400 |
commit | cf612c5949aca2bd81a1e28688957c8149ea2693 (patch) | |
tree | 6c55ef9559a803ce9839f2bba59417be8bb98aed | |
parent | f9bf089a70aab6baac745843b44c152084848f5e (diff) |
rtc: stm32: manage the get_irq probe defer case
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>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r-- | drivers/rtc/rtc-stm32.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c index c5908cfea234..8e6c9b3bcc29 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) | |||
788 | ret = device_init_wakeup(&pdev->dev, true); | 788 | ret = device_init_wakeup(&pdev->dev, true); |
789 | if (rtc->data->has_wakeirq) { | 789 | if (rtc->data->has_wakeirq) { |
790 | rtc->wakeirq_alarm = platform_get_irq(pdev, 1); | 790 | rtc->wakeirq_alarm = platform_get_irq(pdev, 1); |
791 | if (rtc->wakeirq_alarm <= 0) | 791 | if (rtc->wakeirq_alarm > 0) { |
792 | ret = rtc->wakeirq_alarm; | ||
793 | else | ||
794 | ret = dev_pm_set_dedicated_wake_irq(&pdev->dev, | 792 | ret = dev_pm_set_dedicated_wake_irq(&pdev->dev, |
795 | rtc->wakeirq_alarm); | 793 | rtc->wakeirq_alarm); |
794 | } else { | ||
795 | ret = rtc->wakeirq_alarm; | ||
796 | if (rtc->wakeirq_alarm == -EPROBE_DEFER) | ||
797 | goto err; | ||
798 | } | ||
796 | } | 799 | } |
797 | if (ret) | 800 | if (ret) |
798 | dev_warn(&pdev->dev, "alarm can't wake up the system: %d", ret); | 801 | dev_warn(&pdev->dev, "alarm can't wake up the system: %d", ret); |