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