From c68a67c839fd0cd54fb0fce5cf2764548ec45c85 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Tue, 14 Oct 2008 17:01:03 -0600 Subject: [PATCH] --- yaml --- r: 114361 b: refs/heads/master c: 758a7f7bb86b520aadc484f23da85e547b3bf3d8 h: refs/heads/master i: 114359: e1f7c908fa397dbba388b54ecf106b1c3cc6f93e v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/rtc.c | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 218eb2fa50c2..86a7ed4dcf85 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a474aaedac99ba86e28ef6c912a7647c482db6dd +refs/heads/master: 758a7f7bb86b520aadc484f23da85e547b3bf3d8 diff --git a/trunk/arch/x86/kernel/rtc.c b/trunk/arch/x86/kernel/rtc.c index 05191bbc68b8..0a23b5795b25 100644 --- a/trunk/arch/x86/kernel/rtc.c +++ b/trunk/arch/x86/kernel/rtc.c @@ -223,11 +223,25 @@ static struct platform_device rtc_device = { static __init int add_rtc_cmos(void) { #ifdef CONFIG_PNP - if (!pnp_platform_devices) - platform_device_register(&rtc_device); -#else + static const char *ids[] __initconst = + { "PNP0b00", "PNP0b01", "PNP0b02", }; + struct pnp_dev *dev; + struct pnp_id *id; + int i; + + pnp_for_each_dev(dev) { + for (id = dev->id; id; id = id->next) { + for (i = 0; i < ARRAY_SIZE(ids); i++) { + if (compare_pnp_id(id, ids[i]) != 0) + return 0; + } + } + } +#endif + platform_device_register(&rtc_device); -#endif /* CONFIG_PNP */ + dev_info(&rtc_device.dev, + "registered platform RTC device (no PNP device found)\n"); return 0; } device_initcall(add_rtc_cmos);