Version:  2.0.40 2.2.26 2.4.37 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18 3.19 4.0 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8

Linux/drivers/rtc/rtc-generic.c

  1 /* rtc-generic: RTC driver using the generic RTC abstraction
  2  *
  3  * Copyright (C) 2008 Kyle McMartin <kyle@mcmartin.ca>
  4  */
  5 
  6 #include <linux/kernel.h>
  7 #include <linux/module.h>
  8 #include <linux/time.h>
  9 #include <linux/platform_device.h>
 10 #include <linux/rtc.h>
 11 
 12 static int __init generic_rtc_probe(struct platform_device *dev)
 13 {
 14         struct rtc_device *rtc;
 15         const struct rtc_class_ops *ops = dev_get_platdata(&dev->dev);
 16 
 17         rtc = devm_rtc_device_register(&dev->dev, "rtc-generic",
 18                                         ops, THIS_MODULE);
 19         if (IS_ERR(rtc))
 20                 return PTR_ERR(rtc);
 21 
 22         platform_set_drvdata(dev, rtc);
 23 
 24         return 0;
 25 }
 26 
 27 static struct platform_driver generic_rtc_driver = {
 28         .driver = {
 29                 .name = "rtc-generic",
 30         },
 31 };
 32 
 33 module_platform_driver_probe(generic_rtc_driver, generic_rtc_probe);
 34 
 35 MODULE_AUTHOR("Kyle McMartin <kyle@mcmartin.ca>");
 36 MODULE_LICENSE("GPL");
 37 MODULE_DESCRIPTION("Generic RTC driver");
 38 MODULE_ALIAS("platform:rtc-generic");
 39 

This page was automatically generated by LXR 0.3.1 (source).  •  Linux is a registered trademark of Linus Torvalds  •  Contact us