rtc: sc27xx: Set wakeup capability before registering rtc device

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

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
Baolin Wang 2018-10-18 16:52:26 +08:00 коммит произвёл Alexandre Belloni
Родитель ef0f02fd69
Коммит a86d6b23ed
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -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;
}