x86/rtc: Rename mach_set_rtc_mmss() to mach_set_cmos_time()
authorMateusz Jończyk <mat.jonczyk@o2.pl>
Sat, 13 Aug 2022 13:10:34 +0000 (15:10 +0200)
committerIngo Molnar <mingo@kernel.org>
Sun, 14 Aug 2022 09:24:29 +0000 (11:24 +0200)
Once upon a time, before this commit in 2013:

   3195ef59cb42 ("x86: Do full rtc synchronization with ntp")

... the mach_set_rtc_mmss() function set only the minutes and seconds
registers of the CMOS RTC - hence the '_mmss' postfix.

This is no longer true, so rename the function to mach_set_cmos_time().

[ mingo: Expanded changelog a bit. ]

Signed-off-by: Mateusz Jończyk <mat.jonczyk@o2.pl>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20220813131034.768527-2-mat.jonczyk@o2.pl
arch/x86/include/asm/mc146818rtc.h
arch/x86/kernel/rtc.c
arch/x86/kernel/x86_init.c

index 97198001e56760b793b73a7175fc962783316658..6115bb3d5795f19a80d75e60a769514a35792adb 100644 (file)
@@ -95,7 +95,7 @@ static inline unsigned char current_lock_cmos_reg(void)
 unsigned char rtc_cmos_read(unsigned char addr);
 void rtc_cmos_write(unsigned char val, unsigned char addr);
 
-extern int mach_set_rtc_mmss(const struct timespec64 *now);
+extern int mach_set_cmos_time(const struct timespec64 *now);
 extern void mach_get_cmos_time(struct timespec64 *now);
 
 #define RTC_IRQ 8
index 1cadc8a15267360c3dbead3e9c0d40e23909b556..34904643451332f88de1f62a2a34a01833d4a304 100644 (file)
@@ -27,13 +27,13 @@ DEFINE_SPINLOCK(rtc_lock);
 EXPORT_SYMBOL(rtc_lock);
 
 /*
- * In order to set the CMOS clock precisely, set_rtc_mmss has to be
+ * In order to set the CMOS clock precisely, mach_set_cmos_time has to be
  * called 500 ms after the second nowtime has started, because when
  * nowtime is written into the registers of the CMOS clock, it will
  * jump to the next second precisely 500 ms later. Check the Motorola
  * MC146818A or Dallas DS12887 data sheet for details.
  */
-int mach_set_rtc_mmss(const struct timespec64 *now)
+int mach_set_cmos_time(const struct timespec64 *now)
 {
        unsigned long long nowtime = now->tv_sec;
        struct rtc_time tm;
index e84ee5cdbd8c6eb43060e16cb97036b9a5214470..57353519bc119e7458f9a35d172d5f199ba9e75b 100644 (file)
@@ -138,7 +138,7 @@ struct x86_platform_ops x86_platform __ro_after_init = {
        .calibrate_cpu                  = native_calibrate_cpu_early,
        .calibrate_tsc                  = native_calibrate_tsc,
        .get_wallclock                  = mach_get_cmos_time,
-       .set_wallclock                  = mach_set_rtc_mmss,
+       .set_wallclock                  = mach_set_cmos_time,
        .iommu_shutdown                 = iommu_shutdown_noop,
        .is_untracked_pat_range         = is_ISA_range,
        .nmi_init                       = default_nmi_init,