Skip to content

Commit 57c498f

Browse files
johnstultz-workgregkh
authored andcommitted
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>
1 parent e2d8cce commit 57c498f

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎include/linux/alarmtimer.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,7 @@ static inline int alarmtimer_callback_running(struct alarm *timer)
7676
}
7777

7878

79+
/* Provide way to access the rtc device being used by alarmtimers */
80+
struct rtc_device *alarmtimer_get_rtcdev(void);
81+
7982
#endif

‎kernel/time/alarmtimer.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static DEFINE_SPINLOCK(rtcdev_lock);
5959
* If one has not already been chosen, it checks to see if a
6060
* functional rtc device is available.
6161
*/
62-
static struct rtc_device *alarmtimer_get_rtcdev(void)
62+
struct rtc_device *alarmtimer_get_rtcdev(void)
6363
{
6464
unsigned long flags;
6565
struct rtc_device *ret;
@@ -115,7 +115,7 @@ static void alarmtimer_rtc_interface_remove(void)
115115
class_interface_unregister(&alarmtimer_rtc_interface);
116116
}
117117
#else
118-
static inline struct rtc_device *alarmtimer_get_rtcdev(void)
118+
struct rtc_device *alarmtimer_get_rtcdev(void)
119119
{
120120
return NULL;
121121
}

0 commit comments

Comments
 (0)