[PATCH 1/5] rtc: sc27xx: Set wakeup capability before registering rtc device

From: Baolin Wang
Date: Thu Oct 18 2018 - 04:52:49 EST


Set wakeup capability before registering rtc device, in case the alarmtimer
can find one available rtc device.

Signed-off-by: Baolin Wang <baolin.wang@xxxxxxxxxx>
---
drivers/rtc/rtc-sc27xx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-sc27xx.c b/drivers/rtc/rtc-sc27xx.c
index deea5c3..8afba12 100644
--- a/drivers/rtc/rtc-sc27xx.c
+++ b/drivers/rtc/rtc-sc27xx.c
@@ -631,16 +631,18 @@ static int sprd_rtc_probe(struct platform_device *pdev)
return ret;
}

+ device_init_wakeup(&pdev->dev, 1);
+
rtc->rtc->ops = &sprd_rtc_ops;
rtc->rtc->range_min = 0;
rtc->rtc->range_max = 5662310399LL;
ret = rtc_register_device(rtc->rtc);
if (ret) {
dev_err(&pdev->dev, "failed to register rtc device\n");
+ device_init_wakeup(&pdev->dev, 0);
return ret;
}

- device_init_wakeup(&pdev->dev, 1);
return 0;
}

--
1.7.9.5