Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6:
sparc64: Fix offset calculation in compute_size()
rtc: rtc-starfire fixes

+15 -55
+1 -1
arch/sparc64/lib/user_fixup.c
··· 24 if (fault_addr < start || fault_addr >= end) { 25 *offset = 0; 26 } else { 27 - *offset = start - fault_addr; 28 size = end - fault_addr; 29 } 30 return size;
··· 24 if (fault_addr < start || fault_addr >= end) { 25 *offset = 0; 26 } else { 27 + *offset = fault_addr - start; 28 size = end - fault_addr; 29 } 30 return size;
+14 -54
drivers/rtc/rtc-starfire.c
··· 6 #include <linux/kernel.h> 7 #include <linux/module.h> 8 #include <linux/init.h> 9 - #include <linux/time.h> 10 #include <linux/rtc.h> 11 #include <linux/platform_device.h> 12 ··· 14 MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); 15 MODULE_DESCRIPTION("Starfire RTC driver"); 16 MODULE_LICENSE("GPL"); 17 - 18 - struct starfire_rtc { 19 - struct rtc_device *rtc; 20 - spinlock_t lock; 21 - }; 22 23 static u32 starfire_get_time(void) 24 { ··· 29 30 static int starfire_read_time(struct device *dev, struct rtc_time *tm) 31 { 32 - struct starfire_rtc *p = dev_get_drvdata(dev); 33 - unsigned long flags, secs; 34 - 35 - spin_lock_irqsave(&p->lock, flags); 36 - secs = starfire_get_time(); 37 - spin_unlock_irqrestore(&p->lock, flags); 38 - 39 - rtc_time_to_tm(secs, tm); 40 - 41 - return 0; 42 - } 43 - 44 - static int starfire_set_time(struct device *dev, struct rtc_time *tm) 45 - { 46 - unsigned long secs; 47 - int err; 48 - 49 - err = rtc_tm_to_time(tm, &secs); 50 - if (err) 51 - return err; 52 - 53 - /* Do nothing, time is set using the service processor 54 - * console on this platform. 55 - */ 56 - return 0; 57 } 58 59 static const struct rtc_class_ops starfire_rtc_ops = { 60 .read_time = starfire_read_time, 61 - .set_time = starfire_set_time, 62 }; 63 64 - static int __devinit starfire_rtc_probe(struct platform_device *pdev) 65 { 66 - struct starfire_rtc *p = kzalloc(sizeof(*p), GFP_KERNEL); 67 - 68 - if (!p) 69 - return -ENOMEM; 70 - 71 - spin_lock_init(&p->lock); 72 - 73 - p->rtc = rtc_device_register("starfire", &pdev->dev, 74 &starfire_rtc_ops, THIS_MODULE); 75 - if (IS_ERR(p->rtc)) { 76 - int err = PTR_ERR(p->rtc); 77 - kfree(p); 78 - return err; 79 - } 80 - platform_set_drvdata(pdev, p); 81 return 0; 82 } 83 84 - static int __devexit starfire_rtc_remove(struct platform_device *pdev) 85 { 86 - struct starfire_rtc *p = platform_get_drvdata(pdev); 87 88 - rtc_device_unregister(p->rtc); 89 - kfree(p); 90 91 return 0; 92 } ··· 63 .name = "rtc-starfire", 64 .owner = THIS_MODULE, 65 }, 66 - .probe = starfire_rtc_probe, 67 - .remove = __devexit_p(starfire_rtc_remove), 68 }; 69 70 static int __init starfire_rtc_init(void) 71 { 72 - return platform_driver_register(&starfire_rtc_driver); 73 } 74 75 static void __exit starfire_rtc_exit(void)
··· 6 #include <linux/kernel.h> 7 #include <linux/module.h> 8 #include <linux/init.h> 9 #include <linux/rtc.h> 10 #include <linux/platform_device.h> 11 ··· 15 MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); 16 MODULE_DESCRIPTION("Starfire RTC driver"); 17 MODULE_LICENSE("GPL"); 18 19 static u32 starfire_get_time(void) 20 { ··· 35 36 static int starfire_read_time(struct device *dev, struct rtc_time *tm) 37 { 38 + rtc_time_to_tm(starfire_get_time(), tm); 39 + return rtc_valid_tm(tm); 40 } 41 42 static const struct rtc_class_ops starfire_rtc_ops = { 43 .read_time = starfire_read_time, 44 }; 45 46 + static int __init starfire_rtc_probe(struct platform_device *pdev) 47 { 48 + struct rtc_device *rtc = rtc_device_register("starfire", &pdev->dev, 49 &starfire_rtc_ops, THIS_MODULE); 50 + if (IS_ERR(rtc)) 51 + return PTR_ERR(rtc); 52 + 53 + platform_set_drvdata(pdev, rtc); 54 + 55 return 0; 56 } 57 58 + static int __exit starfire_rtc_remove(struct platform_device *pdev) 59 { 60 + struct rtc_device *rtc = platform_get_drvdata(pdev); 61 62 + rtc_device_unregister(rtc); 63 64 return 0; 65 } ··· 102 .name = "rtc-starfire", 103 .owner = THIS_MODULE, 104 }, 105 + .remove = __exit_p(starfire_rtc_remove), 106 }; 107 108 static int __init starfire_rtc_init(void) 109 { 110 + return platform_driver_probe(&starfire_rtc_driver, starfire_rtc_probe); 111 } 112 113 static void __exit starfire_rtc_exit(void)