diff options
Diffstat (limited to 'drivers/rtc/interface.c')
-rw-r--r-- | drivers/rtc/interface.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 37215cf983e9..d43ee409a5f2 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c | |||
@@ -72,7 +72,11 @@ int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm) | |||
72 | err = -ENODEV; | 72 | err = -ENODEV; |
73 | else if (rtc->ops->set_time) | 73 | else if (rtc->ops->set_time) |
74 | err = rtc->ops->set_time(rtc->dev.parent, tm); | 74 | err = rtc->ops->set_time(rtc->dev.parent, tm); |
75 | else if (rtc->ops->set_mmss) { | 75 | else if (rtc->ops->set_mmss64) { |
76 | time64_t secs64 = rtc_tm_to_time64(tm); | ||
77 | |||
78 | err = rtc->ops->set_mmss64(rtc->dev.parent, secs64); | ||
79 | } else if (rtc->ops->set_mmss) { | ||
76 | time64_t secs64 = rtc_tm_to_time64(tm); | 80 | time64_t secs64 = rtc_tm_to_time64(tm); |
77 | err = rtc->ops->set_mmss(rtc->dev.parent, secs64); | 81 | err = rtc->ops->set_mmss(rtc->dev.parent, secs64); |
78 | } else | 82 | } else |
@@ -96,6 +100,8 @@ int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs) | |||
96 | 100 | ||
97 | if (!rtc->ops) | 101 | if (!rtc->ops) |
98 | err = -ENODEV; | 102 | err = -ENODEV; |
103 | else if (rtc->ops->set_mmss64) | ||
104 | err = rtc->ops->set_mmss64(rtc->dev.parent, secs); | ||
99 | else if (rtc->ops->set_mmss) | 105 | else if (rtc->ops->set_mmss) |
100 | err = rtc->ops->set_mmss(rtc->dev.parent, secs); | 106 | err = rtc->ops->set_mmss(rtc->dev.parent, secs); |
101 | else if (rtc->ops->read_time && rtc->ops->set_time) { | 107 | else if (rtc->ops->read_time && rtc->ops->set_time) { |