From patchwork Fri Apr 29 22:03:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 1236 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:50:29 -0000 Delivered-To: patches@linaro.org Received: by 10.224.2.73 with SMTP id 9cs200464qai; Fri, 29 Apr 2011 15:03:45 -0700 (PDT) Received: by 10.150.73.41 with SMTP id v41mr5027796yba.106.1304114625471; Fri, 29 Apr 2011 15:03:45 -0700 (PDT) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx.google.com with ESMTPS id t16si2865509ybe.16.2011.04.29.15.03.44 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Apr 2011 15:03:44 -0700 (PDT) Received-SPF: pass (google.com: domain of jstultz@us.ibm.com designates 32.97.110.149 as permitted sender) client-ip=32.97.110.149; Authentication-Results: mx.google.com; spf=pass (google.com: domain of jstultz@us.ibm.com designates 32.97.110.149 as permitted sender) smtp.mail=jstultz@us.ibm.com Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e31.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p3TLldHR001247; Fri, 29 Apr 2011 15:47:39 -0600 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p3TM3NHF092574; Fri, 29 Apr 2011 16:03:30 -0600 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p3TM3LxH020198; Fri, 29 Apr 2011 16:03:22 -0600 Received: from kernel.beaverton.ibm.com (kernel.beaverton.ibm.com [9.47.67.96]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p3TM3KZH020157; Fri, 29 Apr 2011 16:03:21 -0600 Received: by kernel.beaverton.ibm.com (Postfix, from userid 1056) id 6BE381E750D; Fri, 29 Apr 2011 15:03:20 -0700 (PDT) From: John Stultz To: Thomas Gleixner Cc: John Stultz , Ingo Molnar , Thomas Gleixner Subject: [PATCH 1/2] timers: Fix alarmtimer build issues when CONFIG_RTC_CLASS=n Date: Fri, 29 Apr 2011 15:03:10 -0700 Message-Id: <1304114591-28668-2-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.7.3.2.146.gca209 In-Reply-To: <1304114591-28668-1-git-send-email-john.stultz@linaro.org> References: <1304114591-28668-1-git-send-email-john.stultz@linaro.org> Ingo pointed out that the alarmtimers won't build if CONFIG_RTC_CLASS=n. This patch adds proper ifdefs to the alarmtimer code to disable the rtc usage if it is not built in. CC: Ingo Molnar CC: Thomas Gleixner Reported-by: Ingo Molnar Signed-off-by: John Stultz --- kernel/time/alarmtimer.c | 21 +++++++++++++++++++-- 1 files changed, 19 insertions(+), 2 deletions(-) diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 491e37b..c6f5577 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -42,9 +42,11 @@ static struct alarm_base { clockid_t base_clockid; } alarm_bases[ALARM_NUMTYPE]; +#ifdef CONFIG_RTC_CLASS /* rtc timer and device for setting alarm wakeups at suspend */ static struct rtc_timer rtctimer; static struct rtc_device *rtcdev; +#endif /* freezer delta & lock used to handle clock_nanosleep triggered wakeups */ static ktime_t freezer_delta; @@ -148,7 +150,7 @@ static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer) } - +#ifdef CONFIG_RTC_CLASS /** * alarmtimer_suspend - Suspend time callback * @dev: unused @@ -206,7 +208,12 @@ static int alarmtimer_suspend(struct device *dev) return 0; } - +#else +static int alarmtimer_suspend(struct device *dev) +{ + return 0; +} +#endif static void alarmtimer_freezerset(ktime_t absexp, enum alarmtimer_type type) { @@ -631,6 +638,8 @@ static int __init alarmtimer_init(void) } device_initcall(alarmtimer_init); + +#ifdef CONFIG_RTC_CLASS /** * has_wakealarm - check rtc device has wakealarm ability * @dev: current device @@ -675,4 +684,12 @@ static int __init alarmtimer_init_late(void) return 0; } +#else +static int __init alarmtimer_init_late(void) +{ + printk(KERN_WARNING "Kernel not built with RTC support, ALARM timers" + " will not wake from suspend"); + return 0; +} +#endif late_initcall(alarmtimer_init_late);