rtc-efi-platform.c 879 B

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Moved from arch/ia64/kernel/time.c
  4. *
  5. * Copyright (C) 1998-2003 Hewlett-Packard Co
  6. * Stephane Eranian <eranian@hpl.hp.com>
  7. * David Mosberger <davidm@hpl.hp.com>
  8. * Copyright (C) 1999 Don Dugger <don.dugger@intel.com>
  9. * Copyright (C) 1999-2000 VA Linux Systems
  10. * Copyright (C) 1999-2000 Walt Drummond <drummond@valinux.com>
  11. */
  12. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  13. #include <linux/init.h>
  14. #include <linux/kernel.h>
  15. #include <linux/module.h>
  16. #include <linux/efi.h>
  17. #include <linux/platform_device.h>
  18. static struct platform_device rtc_efi_dev = {
  19. .name = "rtc-efi",
  20. .id = -1,
  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. /* not necessarily an error */
  28. return 0;
  29. }
  30. module_init(rtc_init);