diff options
Diffstat (limited to 'drivers/rtc/class.c')
| -rw-r--r-- | drivers/rtc/class.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 472a5adc4642..ea2a315df6b7 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c | |||
| @@ -55,7 +55,7 @@ static int rtc_suspend(struct device *dev) | |||
| 55 | struct timespec64 delta, delta_delta; | 55 | struct timespec64 delta, delta_delta; |
| 56 | int err; | 56 | int err; |
| 57 | 57 | ||
| 58 | if (has_persistent_clock()) | 58 | if (timekeeping_rtc_skipsuspend()) |
| 59 | return 0; | 59 | return 0; |
| 60 | 60 | ||
| 61 | if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) | 61 | if (strcmp(dev_name(&rtc->dev), CONFIG_RTC_HCTOSYS_DEVICE) != 0) |
| @@ -102,7 +102,7 @@ static int rtc_resume(struct device *dev) | |||
| 102 | struct timespec64 sleep_time; | 102 | struct timespec64 sleep_time; |
| 103 | int err; | 103 | int err; |
| 104 | 104 | ||
| 105 | if (has_persistent_clock()) | 105 | if (timekeeping_rtc_skipresume()) |
| 106 | return 0; | 106 | return 0; |
| 107 | 107 | ||
| 108 | rtc_hctosys_ret = -ENODEV; | 108 | rtc_hctosys_ret = -ENODEV; |
| @@ -117,10 +117,6 @@ static int rtc_resume(struct device *dev) | |||
| 117 | return 0; | 117 | return 0; |
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | if (rtc_valid_tm(&tm) != 0) { | ||
| 121 | pr_debug("%s: bogus resume time\n", dev_name(&rtc->dev)); | ||
| 122 | return 0; | ||
| 123 | } | ||
| 124 | new_rtc.tv_sec = rtc_tm_to_time64(&tm); | 120 | new_rtc.tv_sec = rtc_tm_to_time64(&tm); |
| 125 | new_rtc.tv_nsec = 0; | 121 | new_rtc.tv_nsec = 0; |
| 126 | 122 | ||
| @@ -225,15 +221,15 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev, | |||
| 225 | rtc->pie_timer.function = rtc_pie_update_irq; | 221 | rtc->pie_timer.function = rtc_pie_update_irq; |
| 226 | rtc->pie_enabled = 0; | 222 | rtc->pie_enabled = 0; |
| 227 | 223 | ||
| 224 | strlcpy(rtc->name, name, RTC_DEVICE_NAME_SIZE); | ||
| 225 | dev_set_name(&rtc->dev, "rtc%d", id); | ||
| 226 | |||
| 228 | /* Check to see if there is an ALARM already set in hw */ | 227 | /* Check to see if there is an ALARM already set in hw */ |
| 229 | err = __rtc_read_alarm(rtc, &alrm); | 228 | err = __rtc_read_alarm(rtc, &alrm); |
| 230 | 229 | ||
| 231 | if (!err && !rtc_valid_tm(&alrm.time)) | 230 | if (!err && !rtc_valid_tm(&alrm.time)) |
| 232 | rtc_initialize_alarm(rtc, &alrm); | 231 | rtc_initialize_alarm(rtc, &alrm); |
| 233 | 232 | ||
| 234 | strlcpy(rtc->name, name, RTC_DEVICE_NAME_SIZE); | ||
| 235 | dev_set_name(&rtc->dev, "rtc%d", id); | ||
| 236 | |||
| 237 | rtc_dev_prepare(rtc); | 233 | rtc_dev_prepare(rtc); |
| 238 | 234 | ||
| 239 | err = device_register(&rtc->dev); | 235 | err = device_register(&rtc->dev); |
