summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-cmos.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index 0743c6acd6e2..9cc1c3b53c4b 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -1493,9 +1493,18 @@ static int __init cmos_platform_probe(struct platform_device *pdev)
resource = platform_get_resource(pdev, IORESOURCE_IO, 0);
else
resource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- irq = platform_get_irq(pdev, 0);
- if (irq < 0)
+ irq = platform_get_irq_optional(pdev, 0);
+ if (irq < 0) {
irq = -1;
+#ifdef CONFIG_X86
+ /*
+ * On some x86 systems, the IRQ is not defined, but it should
+ * always be safe to hardcode it on systems with a legacy PIC.
+ */
+ if (nr_legacy_irqs())
+ irq = RTC_IRQ;
+#endif
+ }
return cmos_do_probe(&pdev->dev, resource, irq);
}