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:
rtc: rtc-sun4v fixes, revised
sparc: Fix tty compile warnings.
sparc: struct device - replace bus_id with dev_name(), dev_set_name()

+26 -58
+5 -6
arch/sparc/include/asm/termbits.h
··· 29 29 tcflag_t c_cflag; /* control mode flags */ 30 30 tcflag_t c_lflag; /* local mode flags */ 31 31 cc_t c_line; /* line discipline */ 32 + #ifndef __KERNEL__ 32 33 cc_t c_cc[NCCS]; /* control characters */ 33 - #ifdef __KERNEL__ 34 + #else 35 + cc_t c_cc[NCCS+2]; /* kernel needs 2 more to hold vmin/vtime */ 34 36 #define SIZEOF_USER_TERMIOS sizeof (struct termios) - (2*sizeof (cc_t)) 35 - cc_t _x_cc[2]; /* We need them to hold vmin/vtime */ 36 37 #endif 37 38 }; 38 39 ··· 43 42 tcflag_t c_cflag; /* control mode flags */ 44 43 tcflag_t c_lflag; /* local mode flags */ 45 44 cc_t c_line; /* line discipline */ 46 - cc_t c_cc[NCCS]; /* control characters */ 47 - cc_t _x_cc[2]; /* padding to match ktermios */ 45 + cc_t c_cc[NCCS+2]; /* control characters */ 48 46 speed_t c_ispeed; /* input speed */ 49 47 speed_t c_ospeed; /* output speed */ 50 48 }; ··· 54 54 tcflag_t c_cflag; /* control mode flags */ 55 55 tcflag_t c_lflag; /* local mode flags */ 56 56 cc_t c_line; /* line discipline */ 57 - cc_t c_cc[NCCS]; /* control characters */ 58 - cc_t _x_cc[2]; /* We need them to hold vmin/vtime */ 57 + cc_t c_cc[NCCS+2]; /* control characters */ 59 58 speed_t c_ispeed; /* input speed */ 60 59 speed_t c_ospeed; /* output speed */ 61 60 };
+2 -2
arch/sparc/kernel/of_device.c
··· 563 563 op->dev.parent = parent; 564 564 op->dev.bus = &of_platform_bus_type; 565 565 if (!parent) 566 - strcpy(op->dev.bus_id, "root"); 566 + dev_set_name(&op->dev, "root"); 567 567 else 568 - sprintf(op->dev.bus_id, "%08x", dp->node); 568 + dev_set_name(&op->dev, "%08x", dp->node); 569 569 570 570 if (of_device_register(op)) { 571 571 printk("%s: Could not register of device.\n",
+19 -50
drivers/rtc/rtc-sun4v.c
··· 1 - /* rtc-sun4c.c: Hypervisor based RTC for SUN4V systems. 1 + /* rtc-sun4v.c: Hypervisor based RTC for SUN4V systems. 2 2 * 3 3 * Copyright (C) 2008 David S. Miller <davem@davemloft.net> 4 4 */ ··· 7 7 #include <linux/module.h> 8 8 #include <linux/delay.h> 9 9 #include <linux/init.h> 10 - #include <linux/time.h> 11 10 #include <linux/rtc.h> 12 11 #include <linux/platform_device.h> 13 12 14 13 #include <asm/hypervisor.h> 15 - 16 - MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); 17 - MODULE_DESCRIPTION("SUN4V RTC driver"); 18 - MODULE_LICENSE("GPL"); 19 - 20 - struct sun4v_rtc { 21 - struct rtc_device *rtc; 22 - spinlock_t lock; 23 - }; 24 14 25 15 static unsigned long hypervisor_get_time(void) 26 16 { ··· 35 45 36 46 static int sun4v_read_time(struct device *dev, struct rtc_time *tm) 37 47 { 38 - struct sun4v_rtc *p = dev_get_drvdata(dev); 39 - unsigned long flags, secs; 40 - 41 - spin_lock_irqsave(&p->lock, flags); 42 - secs = hypervisor_get_time(); 43 - spin_unlock_irqrestore(&p->lock, flags); 44 - 45 - rtc_time_to_tm(secs, tm); 46 - 48 + rtc_time_to_tm(hypervisor_get_time(), tm); 47 49 return 0; 48 50 } 49 51 ··· 62 80 63 81 static int sun4v_set_time(struct device *dev, struct rtc_time *tm) 64 82 { 65 - struct sun4v_rtc *p = dev_get_drvdata(dev); 66 - unsigned long flags, secs; 83 + unsigned long secs; 67 84 int err; 68 85 69 86 err = rtc_tm_to_time(tm, &secs); 70 87 if (err) 71 88 return err; 72 89 73 - spin_lock_irqsave(&p->lock, flags); 74 - err = hypervisor_set_time(secs); 75 - spin_unlock_irqrestore(&p->lock, flags); 76 - 77 - return err; 90 + return hypervisor_set_time(secs); 78 91 } 79 92 80 93 static const struct rtc_class_ops sun4v_rtc_ops = { ··· 77 100 .set_time = sun4v_set_time, 78 101 }; 79 102 80 - static int __devinit sun4v_rtc_probe(struct platform_device *pdev) 103 + static int __init sun4v_rtc_probe(struct platform_device *pdev) 81 104 { 82 - struct sun4v_rtc *p = kzalloc(sizeof(*p), GFP_KERNEL); 83 - 84 - if (!p) 85 - return -ENOMEM; 86 - 87 - spin_lock_init(&p->lock); 88 - 89 - p->rtc = rtc_device_register("sun4v", &pdev->dev, 105 + struct rtc_device *rtc = rtc_device_register("sun4v", &pdev->dev, 90 106 &sun4v_rtc_ops, THIS_MODULE); 91 - if (IS_ERR(p->rtc)) { 92 - int err = PTR_ERR(p->rtc); 93 - kfree(p); 94 - return err; 95 - } 96 - platform_set_drvdata(pdev, p); 107 + if (IS_ERR(rtc)) 108 + return PTR_ERR(rtc); 109 + 110 + platform_set_drvdata(pdev, rtc); 97 111 return 0; 98 112 } 99 113 100 - static int __devexit sun4v_rtc_remove(struct platform_device *pdev) 114 + static int __exit sun4v_rtc_remove(struct platform_device *pdev) 101 115 { 102 - struct sun4v_rtc *p = platform_get_drvdata(pdev); 116 + struct rtc_device *rtc = platform_get_drvdata(pdev); 103 117 104 - rtc_device_unregister(p->rtc); 105 - kfree(p); 106 - 118 + rtc_device_unregister(rtc); 107 119 return 0; 108 120 } 109 121 ··· 101 135 .name = "rtc-sun4v", 102 136 .owner = THIS_MODULE, 103 137 }, 104 - .probe = sun4v_rtc_probe, 105 - .remove = __devexit_p(sun4v_rtc_remove), 138 + .remove = __exit_p(sun4v_rtc_remove), 106 139 }; 107 140 108 141 static int __init sun4v_rtc_init(void) 109 142 { 110 - return platform_driver_register(&sun4v_rtc_driver); 143 + return platform_driver_probe(&sun4v_rtc_driver, sun4v_rtc_probe); 111 144 } 112 145 113 146 static void __exit sun4v_rtc_exit(void) ··· 116 151 117 152 module_init(sun4v_rtc_init); 118 153 module_exit(sun4v_rtc_exit); 154 + 155 + MODULE_AUTHOR("David S. Miller <davem@davemloft.net>"); 156 + MODULE_DESCRIPTION("SUN4V RTC driver"); 157 + MODULE_LICENSE("GPL");