{
        struct timespec64 next;
 
-       getnstimeofday64(&next);
+       ktime_get_real_ts64(&next);
        if (!fail)
                next.tv_sec = 659;
        else {
        if (!IS_ENABLED(CONFIG_RTC_SYSTOHC))
                return;
 
-       getnstimeofday64(&now);
+       ktime_get_real_ts64(&now);
 
        adjust = now;
        if (persistent_clock_is_local)
         * Architectures are strongly encouraged to use rtclib and not
         * implement this legacy API.
         */
-       getnstimeofday64(&now);
+       ktime_get_real_ts64(&now);
        if (rtc_tv_nsec_ok(-1 * target_nsec, &adjust, &now)) {
                if (persistent_clock_is_local)
                        adjust.tv_sec -= (sys_tz.tz_minuteswest * 60);
 
                        return ret;
        }
 
-       getnstimeofday64(&ts);
+       ktime_get_real_ts64(&ts);
 
        raw_spin_lock_irqsave(&timekeeper_lock, flags);
        write_seqcount_begin(&tk_core.seq);