public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] timers: Make alarmtimer depend on CONFIG_RTC_CLASS
@ 2011-05-29 10:48 Richard Weinberger
  2011-06-01  6:38 ` John Stultz
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Weinberger @ 2011-05-29 10:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: john.stultz, richard.cochran, tglx, arnd, peterz, toralf.foerster,
	Richard Weinberger

The alarmtimer interface makes IMHO only sense when a RTC device
is available.
On systems with !CONFIG_RTC_CLASS (like UML) the warning
"Kernel not built with RTC support, ALARM timers will not wake from suspend"
is annoying.

Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 kernel/time/Makefile     |    3 ++-
 kernel/time/alarmtimer.c |   19 +------------------
 2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/kernel/time/Makefile b/kernel/time/Makefile
index e2fd74b..224f833 100644
--- a/kernel/time/Makefile
+++ b/kernel/time/Makefile
@@ -1,6 +1,7 @@
 obj-y += timekeeping.o ntp.o clocksource.o jiffies.o timer_list.o timecompare.o
-obj-y += timeconv.o posix-clock.o alarmtimer.o
+obj-y += timeconv.o posix-clock.o
 
+obj-$(CONFIG_RTC_CLASS) += alarmtimer.o
 obj-$(CONFIG_GENERIC_CLOCKEVENTS_BUILD)		+= clockevents.o
 obj-$(CONFIG_GENERIC_CLOCKEVENTS)		+= tick-common.o
 obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)	+= tick-broadcast.o
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 2d96624..c1f2898 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -42,11 +42,9 @@ 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;
@@ -150,7 +148,6 @@ static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer)
 
 }
 
-#ifdef CONFIG_RTC_CLASS
 /**
  * alarmtimer_suspend - Suspend time callback
  * @dev: unused
@@ -208,12 +205,6 @@ 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)
 {
@@ -638,7 +629,6 @@ 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
@@ -691,12 +681,5 @@ 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);
-- 
1.7.5.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-01 12:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-29 10:48 [RFC][PATCH] timers: Make alarmtimer depend on CONFIG_RTC_CLASS Richard Weinberger
2011-06-01  6:38 ` John Stultz
2011-06-01  9:13   ` Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox