aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Belloni <[email protected]>2021-08-04 12:41:31 +0200
committerAlexandre Belloni <[email protected]>2021-08-06 10:31:59 +0200
commit308247d20464a684f335001f2f835240e67f9126 (patch)
treec45e58e29442b0cb1e6efe1a8c02004cfbf34a07
parent1ed4dba2bc166bae5af713a114ed91619ef70c43 (diff)
rtc: s5m: enable wakeup only when available
Call device_init_wakeup() only when alarms are available and the RTC is actually able to wake up the system. Signed-off-by: Alexandre Belloni <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--drivers/rtc/rtc-s5m.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index ee195697e6c6..87df797758fc 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -786,8 +786,6 @@ static int s5m_rtc_probe(struct platform_device *pdev)
if (ret)
return ret;
- device_init_wakeup(&pdev->dev, 1);
-
info->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(info->rtc_dev))
return PTR_ERR(info->rtc_dev);
@@ -805,6 +803,7 @@ static int s5m_rtc_probe(struct platform_device *pdev)
info->irq, ret);
return ret;
}
+ device_init_wakeup(&pdev->dev, 1);
}
return devm_rtc_register_device(info->rtc_dev);