mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-12-23 22:49:28 -05:00
61 lines
1.8 KiB
Diff
61 lines
1.8 KiB
Diff
From ea2cc0f11b89637cb0837ca381a5189af7fb03ab Mon Sep 17 00:00:00 2001
|
|
From: Tad <tad@spotco.us>
|
|
Date: Tue, 26 May 2015 14:26:28 -0400
|
|
Subject: [PATCH] Fix build failure
|
|
|
|
---
|
|
kernel/time/alarmtimer.c | 23 ++++++++---------------
|
|
1 file changed, 8 insertions(+), 15 deletions(-)
|
|
|
|
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
|
|
index f0239cc..c4f3fdd 100644
|
|
--- a/kernel/time/alarmtimer.c
|
|
+++ b/kernel/time/alarmtimer.c
|
|
@@ -731,9 +731,6 @@ static int alarm_timer_create(struct k_itimer *new_timer)
|
|
if (!alarmtimer_get_rtcdev())
|
|
return -ENOTSUPP;
|
|
|
|
- if (flags & ~TIMER_ABSTIME)
|
|
- return -EINVAL;
|
|
-
|
|
if (!capable(CAP_WAKE_ALARM))
|
|
return -EPERM;
|
|
|
|
@@ -748,22 +745,18 @@ static int alarm_timer_create(struct k_itimer *new_timer)
|
|
* @new_timer: k_itimer pointer
|
|
* @cur_setting: itimerspec data to fill
|
|
*
|
|
- * Copies out the current itimerspec data
|
|
+ * Copies the itimerspec data out from the k_itimer
|
|
*/
|
|
static void alarm_timer_get(struct k_itimer *timr,
|
|
struct itimerspec *cur_setting)
|
|
{
|
|
- ktime_t relative_expiry_time =
|
|
- alarm_expires_remaining(&(timr->it.alarm.alarmtimer));
|
|
+ memset(cur_setting, 0, sizeof(struct itimerspec));
|
|
|
|
- if (ktime_to_ns(relative_expiry_time) > 0) {
|
|
- cur_setting->it_value = ktime_to_timespec(relative_expiry_time);
|
|
- } else {
|
|
- cur_setting->it_value.tv_sec = 0;
|
|
- cur_setting->it_value.tv_nsec = 0;
|
|
- }
|
|
-
|
|
- cur_setting->it_interval = ktime_to_timespec(timr->it.alarm.interval);
|
|
+ cur_setting->it_interval =
|
|
+ ktime_to_timespec(timr->it.alarm.interval);
|
|
+ cur_setting->it_value =
|
|
+ ktime_to_timespec(timr->it.alarm.alarmtimer.node.expires);
|
|
+ return;
|
|
}
|
|
|
|
/**
|
|
@@ -1070,4 +1063,4 @@ static int __init alarmtimer_init(void)
|
|
alarmtimer_rtc_interface_remove();
|
|
return error;
|
|
}
|
|
-device_initcall(alarmtimer_init);
|
|
+device_initcall(alarmtimer_init);
|
|
\ No newline at end of file
|