]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/rtc/rtc-ds1742.c
rtc: fix platform driver hotplug/coldplug
[linux-2.6-omap-h63xx.git] / drivers / rtc / rtc-ds1742.c
index d1778ae8bca58c6e9b8a45dc534e4345b21cc7a8..24d35ede2dbff92de8fca76f3354337895eba97c 100644 (file)
@@ -55,7 +55,7 @@ struct rtc_plat_data {
        void __iomem *ioaddr_rtc;
        size_t size_nvram;
        size_t size;
-       unsigned long baseaddr;
+       resource_size_t baseaddr;
        unsigned long last_jiffies;
 };
 
@@ -160,10 +160,13 @@ static ssize_t ds1742_nvram_write(struct kobject *kobj,
 static struct bin_attribute ds1742_nvram_attr = {
        .attr = {
                .name = "nvram",
-               .mode = S_IRUGO | S_IWUGO,
+               .mode = S_IRUGO | S_IWUSR,
        },
        .read = ds1742_nvram_read,
        .write = ds1742_nvram_write,
+       /* REVISIT: size in sysfs won't match actual size... if it's
+        * not a constant, each RTC should have its own attribute.
+        */
 };
 
 static int __devinit ds1742_rtc_probe(struct platform_device *pdev)
@@ -251,7 +254,7 @@ static struct platform_driver ds1742_rtc_driver = {
        .probe          = ds1742_rtc_probe,
        .remove         = __devexit_p(ds1742_rtc_remove),
        .driver         = {
-               .name   = "ds1742",
+               .name   = "rtc-ds1742",
                .owner  = THIS_MODULE,
        },
 };
@@ -263,7 +266,7 @@ static __init int ds1742_init(void)
 
 static __exit void ds1742_exit(void)
 {
-       return platform_driver_unregister(&ds1742_rtc_driver);
+       platform_driver_unregister(&ds1742_rtc_driver);
 }
 
 module_init(ds1742_init);
@@ -273,3 +276,4 @@ MODULE_AUTHOR("Atsushi Nemoto <anemo@mba.ocn.ne.jp>");
 MODULE_DESCRIPTION("Dallas DS1742 RTC driver");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_VERSION);
+MODULE_ALIAS("platform:rtc-ds1742");