Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

alarmtimer: Provide accessor to alarmtimer rtc device

The Android alarm interface provides a settime call that sets both
the alarmtimer RTC device and CLOCK_REALTIME to the same value.

Since there may be multiple rtc devices, provide a hook to access the
one the alarmtimer infrastructure is using.

CC: Colin Cross <ccross@android.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Android Kernel Team <kernel-team@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

John Stultz and committed by
Greg Kroah-Hartman
57c498fa e2d8ccef

+5 -2
+3
include/linux/alarmtimer.h
··· 76 76 } 77 77 78 78 79 + /* Provide way to access the rtc device being used by alarmtimers */ 80 + struct rtc_device *alarmtimer_get_rtcdev(void); 81 + 79 82 #endif
+2 -2
kernel/time/alarmtimer.c
··· 59 59 * If one has not already been chosen, it checks to see if a 60 60 * functional rtc device is available. 61 61 */ 62 - static struct rtc_device *alarmtimer_get_rtcdev(void) 62 + struct rtc_device *alarmtimer_get_rtcdev(void) 63 63 { 64 64 unsigned long flags; 65 65 struct rtc_device *ret; ··· 115 115 class_interface_unregister(&alarmtimer_rtc_interface); 116 116 } 117 117 #else 118 - static inline struct rtc_device *alarmtimer_get_rtcdev(void) 118 + struct rtc_device *alarmtimer_get_rtcdev(void) 119 119 { 120 120 return NULL; 121 121 }