From e4c510ac25000f50e7ecc3e7c52ed8c8eabfb8f1 Mon Sep 17 00:00:00 2001 From: Anton Vorontsov Date: Thu, 12 Jun 2008 03:04:31 +0400 Subject: [PATCH] --- yaml --- r: 107133 b: refs/heads/master c: e517881e427757afc3cce6d76173b1d898b30ab3 h: refs/heads/master i: 107131: feb71bb955b1e2852e8b557938054f95de043bbe v: v3 --- [refs] | 2 +- trunk/arch/powerpc/sysdev/rtc_cmos_setup.c | 23 ++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 767befe967af..18c912d8d151 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 80776554b6c93cf828ddc702010c6a189aa0d0e9 +refs/heads/master: e517881e427757afc3cce6d76173b1d898b30ab3 diff --git a/trunk/arch/powerpc/sysdev/rtc_cmos_setup.c b/trunk/arch/powerpc/sysdev/rtc_cmos_setup.c index c09ddc0dbeb3..c1879ebfd4f4 100644 --- a/trunk/arch/powerpc/sysdev/rtc_cmos_setup.c +++ b/trunk/arch/powerpc/sysdev/rtc_cmos_setup.c @@ -21,6 +21,7 @@ static int __init add_rtc(void) struct device_node *np; struct platform_device *pd; struct resource res[2]; + unsigned int num_res = 1; int ret; memset(&res, 0, sizeof(res)); @@ -41,14 +42,24 @@ static int __init add_rtc(void) if (res[0].start != RTC_PORT(0)) return -EINVAL; - /* Use a fixed interrupt value of 8 since on PPC if we are using this - * its off an i8259 which we ensure has interrupt numbers 0..15. */ - res[1].start = 8; - res[1].end = 8; - res[1].flags = IORESOURCE_IRQ; + np = of_find_compatible_node(NULL, NULL, "chrp,iic"); + if (!np) + np = of_find_compatible_node(NULL, NULL, "pnpPNP,000"); + if (np) { + of_node_put(np); + /* + * Use a fixed interrupt value of 8 since on PPC if we are + * using this its off an i8259 which we ensure has interrupt + * numbers 0..15. + */ + res[1].start = 8; + res[1].end = 8; + res[1].flags = IORESOURCE_IRQ; + num_res++; + } pd = platform_device_register_simple("rtc_cmos", -1, - &res[0], 2); + &res[0], num_res); if (IS_ERR(pd)) return PTR_ERR(pd);