lkml.org 
[lkml]   [2011]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateTue, 4 Jan 2011 14:28:46 +0100
FromSebastian Andrzej Siewior <>
Subject[PATCH v2 13/15] x86/rtc: don't register rtc if we the DT blob
or we might end up with two device nodes for the same hardware.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/x86/kernel/rtc.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/rtc.c b/arch/x86/kernel/rtc.c
index 1cfbbfc..0cfa138 100644
--- a/arch/x86/kernel/rtc.c
+++ b/arch/x86/kernel/rtc.c
@@ -6,6 +6,7 @@
#include <linux/acpi.h>
#include <linux/bcd.h>
#include <linux/pnp.h>
+#include <linux/of.h>

#include <asm/vsyscall.h>
#include <asm/x86_init.h>
@@ -218,6 +219,20 @@ static struct platform_device rtc_device = {
.num_resources = ARRAY_SIZE(rtc_resources),
};

+#ifdef CONFIG_OF
+static __init int have_DTB(void)
+{
+ if (initial_boot_params)
+ return 1;
+ return 0;
+}
+#else
+static inline int have_DTB(void)
+{
+ return 0;
+}
+#endif
+
static __init int add_rtc_cmos(void)
{
#ifdef CONFIG_PNP
@@ -237,6 +252,9 @@ static __init int add_rtc_cmos(void)
}
#endif

+ if (have_DTB())
+ return 0;
+
platform_device_register(&rtc_device);
dev_info(&rtc_device.dev,
"registered platform RTC device (no PNP device found)\n");
--
1.7.3.2


\
 
 \ /
  Last update: 2011-01-04 14:31    [from the cache]
©2003-2010