DivestOS/Patches/OLD/bacon/Kernel-CM-12.1/12.patch

61 lines
1.8 KiB
Diff
Raw Normal View History

2016-12-21 19:30:02 -05:00
From 11812dfbd7b16cfff83389f3d017702bfb0320e9 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