Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: ia64: allow other architectures to use EFI RTC

Currently, the rtc-efi driver is restricted to ia64 only. Newer
architectures with EFI support may want to also use that driver. This
patch moves the platform device setup from ia64 into drivers/rtc and
allow any architecture with CONFIG_EFI=y to use the rtc-efi driver.

Signed-off-by: Mark Salter <msalter@redhat.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Mark Salter and committed by
Linus Torvalds
da167ad7 ca6dc2da

+36 -16
-15
arch/ia64/kernel/time.c
··· 384 384 .name = "timer" 385 385 }; 386 386 387 - static struct platform_device rtc_efi_dev = { 388 - .name = "rtc-efi", 389 - .id = -1, 390 - }; 391 - 392 - static int __init rtc_init(void) 393 - { 394 - if (platform_device_register(&rtc_efi_dev) < 0) 395 - printk(KERN_ERR "unable to register rtc device...\n"); 396 - 397 - /* not necessarily an error */ 398 - return 0; 399 - } 400 - module_init(rtc_init); 401 - 402 387 void read_persistent_clock(struct timespec *ts) 403 388 { 404 389 efi_gettimeofday(ts);
+1 -1
drivers/rtc/Kconfig
··· 798 798 799 799 config RTC_DRV_EFI 800 800 tristate "EFI RTC" 801 - depends on IA64 801 + depends on EFI 802 802 help 803 803 If you say yes here you will get support for the EFI 804 804 Real Time Clock.
+4
drivers/rtc/Makefile
··· 10 10 obj-$(CONFIG_RTC_CLASS) += rtc-core.o 11 11 rtc-core-y := class.o interface.o 12 12 13 + ifdef CONFIG_RTC_DRV_EFI 14 + rtc-core-y += rtc-efi-platform.o 15 + endif 16 + 13 17 rtc-core-$(CONFIG_RTC_INTF_DEV) += rtc-dev.o 14 18 rtc-core-$(CONFIG_RTC_INTF_PROC) += rtc-proc.o 15 19 rtc-core-$(CONFIG_RTC_INTF_SYSFS) += rtc-sysfs.o
+31
drivers/rtc/rtc-efi-platform.c
··· 1 + /* 2 + * Moved from arch/ia64/kernel/time.c 3 + * 4 + * Copyright (C) 1998-2003 Hewlett-Packard Co 5 + * Stephane Eranian <eranian@hpl.hp.com> 6 + * David Mosberger <davidm@hpl.hp.com> 7 + * Copyright (C) 1999 Don Dugger <don.dugger@intel.com> 8 + * Copyright (C) 1999-2000 VA Linux Systems 9 + * Copyright (C) 1999-2000 Walt Drummond <drummond@valinux.com> 10 + */ 11 + #include <linux/init.h> 12 + #include <linux/kernel.h> 13 + #include <linux/module.h> 14 + #include <linux/efi.h> 15 + #include <linux/platform_device.h> 16 + 17 + static struct platform_device rtc_efi_dev = { 18 + .name = "rtc-efi", 19 + .id = -1, 20 + }; 21 + 22 + static int __init rtc_init(void) 23 + { 24 + if (efi_enabled(EFI_RUNTIME_SERVICES)) 25 + if (platform_device_register(&rtc_efi_dev) < 0) 26 + pr_err("unable to register rtc device...\n"); 27 + 28 + /* not necessarily an error */ 29 + return 0; 30 + } 31 + module_init(rtc_init);