diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/bsr.c | 2 | ||||
-rw-r--r-- | drivers/char/hvc_console.c | 12 | ||||
-rw-r--r-- | drivers/char/hvc_irq.c | 2 | ||||
-rw-r--r-- | drivers/char/ps3flash.c | 18 | ||||
-rw-r--r-- | drivers/char/synclink_gt.c | 16 | ||||
-rw-r--r-- | drivers/char/sysrq.c | 6 | ||||
-rw-r--r-- | drivers/char/tty_ioctl.c | 2 |
7 files changed, 30 insertions, 28 deletions
diff --git a/drivers/char/bsr.c b/drivers/char/bsr.c index 977dfb1096a0..f6094ae0ef33 100644 --- a/drivers/char/bsr.c +++ b/drivers/char/bsr.c | |||
@@ -103,7 +103,7 @@ static ssize_t | |||
103 | bsr_len_show(struct device *dev, struct device_attribute *attr, char *buf) | 103 | bsr_len_show(struct device *dev, struct device_attribute *attr, char *buf) |
104 | { | 104 | { |
105 | struct bsr_dev *bsr_dev = dev_get_drvdata(dev); | 105 | struct bsr_dev *bsr_dev = dev_get_drvdata(dev); |
106 | return sprintf(buf, "%lu\n", bsr_dev->bsr_len); | 106 | return sprintf(buf, "%llu\n", bsr_dev->bsr_len); |
107 | } | 107 | } |
108 | 108 | ||
109 | static struct device_attribute bsr_dev_attrs[] = { | 109 | static struct device_attribute bsr_dev_attrs[] = { |
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index 5a8a4c28c867..94e7e3c8c05a 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c | |||
@@ -318,7 +318,6 @@ static int hvc_open(struct tty_struct *tty, struct file * filp) | |||
318 | } /* else count == 0 */ | 318 | } /* else count == 0 */ |
319 | 319 | ||
320 | tty->driver_data = hp; | 320 | tty->driver_data = hp; |
321 | tty->low_latency = 1; /* Makes flushes to ldisc synchronous. */ | ||
322 | 321 | ||
323 | hp->tty = tty; | 322 | hp->tty = tty; |
324 | 323 | ||
@@ -764,13 +763,11 @@ struct hvc_struct __devinit *hvc_alloc(uint32_t vtermno, int data, | |||
764 | return ERR_PTR(err); | 763 | return ERR_PTR(err); |
765 | } | 764 | } |
766 | 765 | ||
767 | hp = kmalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size, | 766 | hp = kzalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size, |
768 | GFP_KERNEL); | 767 | GFP_KERNEL); |
769 | if (!hp) | 768 | if (!hp) |
770 | return ERR_PTR(-ENOMEM); | 769 | return ERR_PTR(-ENOMEM); |
771 | 770 | ||
772 | memset(hp, 0x00, sizeof(*hp)); | ||
773 | |||
774 | hp->vtermno = vtermno; | 771 | hp->vtermno = vtermno; |
775 | hp->data = data; | 772 | hp->data = data; |
776 | hp->ops = ops; | 773 | hp->ops = ops; |
@@ -876,8 +873,11 @@ static int hvc_init(void) | |||
876 | goto stop_thread; | 873 | goto stop_thread; |
877 | } | 874 | } |
878 | 875 | ||
879 | /* FIXME: This mb() seems completely random. Remove it. */ | 876 | /* |
880 | mb(); | 877 | * Make sure tty is fully registered before allowing it to be |
878 | * found by hvc_console_device. | ||
879 | */ | ||
880 | smp_mb(); | ||
881 | hvc_driver = drv; | 881 | hvc_driver = drv; |
882 | return 0; | 882 | return 0; |
883 | 883 | ||
diff --git a/drivers/char/hvc_irq.c b/drivers/char/hvc_irq.c index d09e5688d449..2623e177e8d6 100644 --- a/drivers/char/hvc_irq.c +++ b/drivers/char/hvc_irq.c | |||
@@ -37,7 +37,7 @@ int notifier_add_irq(struct hvc_struct *hp, int irq) | |||
37 | 37 | ||
38 | void notifier_del_irq(struct hvc_struct *hp, int irq) | 38 | void notifier_del_irq(struct hvc_struct *hp, int irq) |
39 | { | 39 | { |
40 | if (!irq) | 40 | if (!hp->irq_requested) |
41 | return; | 41 | return; |
42 | free_irq(irq, hp); | 42 | free_irq(irq, hp); |
43 | hp->irq_requested = 0; | 43 | hp->irq_requested = 0; |
diff --git a/drivers/char/ps3flash.c b/drivers/char/ps3flash.c index 79b6f461be75..afbe45676d71 100644 --- a/drivers/char/ps3flash.c +++ b/drivers/char/ps3flash.c | |||
@@ -44,7 +44,7 @@ static ssize_t ps3flash_read_write_sectors(struct ps3_storage_device *dev, | |||
44 | u64 res = ps3stor_read_write_sectors(dev, lpar, start_sector, sectors, | 44 | u64 res = ps3stor_read_write_sectors(dev, lpar, start_sector, sectors, |
45 | write); | 45 | write); |
46 | if (res) { | 46 | if (res) { |
47 | dev_err(&dev->sbd.core, "%s:%u: %s failed 0x%lx\n", __func__, | 47 | dev_err(&dev->sbd.core, "%s:%u: %s failed 0x%llx\n", __func__, |
48 | __LINE__, write ? "write" : "read", res); | 48 | __LINE__, write ? "write" : "read", res); |
49 | return -EIO; | 49 | return -EIO; |
50 | } | 50 | } |
@@ -59,7 +59,7 @@ static ssize_t ps3flash_read_sectors(struct ps3_storage_device *dev, | |||
59 | 59 | ||
60 | max_sectors = dev->bounce_size / dev->blk_size; | 60 | max_sectors = dev->bounce_size / dev->blk_size; |
61 | if (sectors > max_sectors) { | 61 | if (sectors > max_sectors) { |
62 | dev_dbg(&dev->sbd.core, "%s:%u Limiting sectors to %lu\n", | 62 | dev_dbg(&dev->sbd.core, "%s:%u Limiting sectors to %llu\n", |
63 | __func__, __LINE__, max_sectors); | 63 | __func__, __LINE__, max_sectors); |
64 | sectors = max_sectors; | 64 | sectors = max_sectors; |
65 | } | 65 | } |
@@ -144,7 +144,7 @@ static ssize_t ps3flash_read(struct file *file, char __user *buf, size_t count, | |||
144 | goto fail; | 144 | goto fail; |
145 | } | 145 | } |
146 | 146 | ||
147 | n = min(remaining, sectors_read*dev->blk_size-offset); | 147 | n = min_t(u64, remaining, sectors_read*dev->blk_size-offset); |
148 | dev_dbg(&dev->sbd.core, | 148 | dev_dbg(&dev->sbd.core, |
149 | "%s:%u: copy %lu bytes from 0x%p to user 0x%p\n", | 149 | "%s:%u: copy %lu bytes from 0x%p to user 0x%p\n", |
150 | __func__, __LINE__, n, dev->bounce_buf+offset, buf); | 150 | __func__, __LINE__, n, dev->bounce_buf+offset, buf); |
@@ -225,7 +225,7 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf, | |||
225 | if (end_read_sector >= start_read_sector) { | 225 | if (end_read_sector >= start_read_sector) { |
226 | /* Merge head and tail */ | 226 | /* Merge head and tail */ |
227 | dev_dbg(&dev->sbd.core, | 227 | dev_dbg(&dev->sbd.core, |
228 | "Merged head and tail: %lu sectors at %lu\n", | 228 | "Merged head and tail: %llu sectors at %llu\n", |
229 | chunk_sectors, start_write_sector); | 229 | chunk_sectors, start_write_sector); |
230 | res = ps3flash_read_sectors(dev, start_write_sector, | 230 | res = ps3flash_read_sectors(dev, start_write_sector, |
231 | chunk_sectors, 0); | 231 | chunk_sectors, 0); |
@@ -235,7 +235,7 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf, | |||
235 | if (head) { | 235 | if (head) { |
236 | /* Read head */ | 236 | /* Read head */ |
237 | dev_dbg(&dev->sbd.core, | 237 | dev_dbg(&dev->sbd.core, |
238 | "head: %lu sectors at %lu\n", head, | 238 | "head: %llu sectors at %llu\n", head, |
239 | start_write_sector); | 239 | start_write_sector); |
240 | res = ps3flash_read_sectors(dev, | 240 | res = ps3flash_read_sectors(dev, |
241 | start_write_sector, | 241 | start_write_sector, |
@@ -247,7 +247,7 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf, | |||
247 | start_write_sector+chunk_sectors) { | 247 | start_write_sector+chunk_sectors) { |
248 | /* Read tail */ | 248 | /* Read tail */ |
249 | dev_dbg(&dev->sbd.core, | 249 | dev_dbg(&dev->sbd.core, |
250 | "tail: %lu sectors at %lu\n", tail, | 250 | "tail: %llu sectors at %llu\n", tail, |
251 | start_read_sector); | 251 | start_read_sector); |
252 | sec_off = start_read_sector-start_write_sector; | 252 | sec_off = start_read_sector-start_write_sector; |
253 | res = ps3flash_read_sectors(dev, | 253 | res = ps3flash_read_sectors(dev, |
@@ -258,7 +258,7 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf, | |||
258 | } | 258 | } |
259 | } | 259 | } |
260 | 260 | ||
261 | n = min(remaining, dev->bounce_size-offset); | 261 | n = min_t(u64, remaining, dev->bounce_size-offset); |
262 | dev_dbg(&dev->sbd.core, | 262 | dev_dbg(&dev->sbd.core, |
263 | "%s:%u: copy %lu bytes from user 0x%p to 0x%p\n", | 263 | "%s:%u: copy %lu bytes from user 0x%p to 0x%p\n", |
264 | __func__, __LINE__, n, buf, dev->bounce_buf+offset); | 264 | __func__, __LINE__, n, buf, dev->bounce_buf+offset); |
@@ -299,11 +299,11 @@ static irqreturn_t ps3flash_interrupt(int irq, void *data) | |||
299 | 299 | ||
300 | if (tag != dev->tag) | 300 | if (tag != dev->tag) |
301 | dev_err(&dev->sbd.core, | 301 | dev_err(&dev->sbd.core, |
302 | "%s:%u: tag mismatch, got %lx, expected %lx\n", | 302 | "%s:%u: tag mismatch, got %llx, expected %llx\n", |
303 | __func__, __LINE__, tag, dev->tag); | 303 | __func__, __LINE__, tag, dev->tag); |
304 | 304 | ||
305 | if (res) { | 305 | if (res) { |
306 | dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%lx\n", | 306 | dev_err(&dev->sbd.core, "%s:%u: res=%d status=0x%llx\n", |
307 | __func__, __LINE__, res, status); | 307 | __func__, __LINE__, res, status); |
308 | } else { | 308 | } else { |
309 | dev->lv1_status = status; | 309 | dev->lv1_status = status; |
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index 53544e21f191..f329f459817c 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: synclink_gt.c,v 4.50 2007/07/25 19:29:25 paulkf Exp $ | ||
3 | * | ||
4 | * Device driver for Microgate SyncLink GT serial adapters. | 2 | * Device driver for Microgate SyncLink GT serial adapters. |
5 | * | 3 | * |
6 | * written by Paul Fulghum for Microgate Corporation | 4 | * written by Paul Fulghum for Microgate Corporation |
@@ -91,7 +89,6 @@ | |||
91 | * module identification | 89 | * module identification |
92 | */ | 90 | */ |
93 | static char *driver_name = "SyncLink GT"; | 91 | static char *driver_name = "SyncLink GT"; |
94 | static char *driver_version = "$Revision: 4.50 $"; | ||
95 | static char *tty_driver_name = "synclink_gt"; | 92 | static char *tty_driver_name = "synclink_gt"; |
96 | static char *tty_dev_prefix = "ttySLG"; | 93 | static char *tty_dev_prefix = "ttySLG"; |
97 | MODULE_LICENSE("GPL"); | 94 | MODULE_LICENSE("GPL"); |
@@ -1309,7 +1306,7 @@ static int read_proc(char *page, char **start, off_t off, int count, | |||
1309 | off_t begin = 0; | 1306 | off_t begin = 0; |
1310 | struct slgt_info *info; | 1307 | struct slgt_info *info; |
1311 | 1308 | ||
1312 | len += sprintf(page, "synclink_gt driver:%s\n", driver_version); | 1309 | len += sprintf(page, "synclink_gt driver\n"); |
1313 | 1310 | ||
1314 | info = slgt_device_list; | 1311 | info = slgt_device_list; |
1315 | while( info ) { | 1312 | while( info ) { |
@@ -2441,7 +2438,7 @@ static void program_hw(struct slgt_info *info) | |||
2441 | info->ri_chkcount = 0; | 2438 | info->ri_chkcount = 0; |
2442 | info->dsr_chkcount = 0; | 2439 | info->dsr_chkcount = 0; |
2443 | 2440 | ||
2444 | slgt_irq_on(info, IRQ_DCD | IRQ_CTS | IRQ_DSR); | 2441 | slgt_irq_on(info, IRQ_DCD | IRQ_CTS | IRQ_DSR | IRQ_RI); |
2445 | get_signals(info); | 2442 | get_signals(info); |
2446 | 2443 | ||
2447 | if (info->netcount || | 2444 | if (info->netcount || |
@@ -3576,7 +3573,7 @@ static void slgt_cleanup(void) | |||
3576 | struct slgt_info *info; | 3573 | struct slgt_info *info; |
3577 | struct slgt_info *tmp; | 3574 | struct slgt_info *tmp; |
3578 | 3575 | ||
3579 | printk("unload %s %s\n", driver_name, driver_version); | 3576 | printk(KERN_INFO "unload %s\n", driver_name); |
3580 | 3577 | ||
3581 | if (serial_driver) { | 3578 | if (serial_driver) { |
3582 | for (info=slgt_device_list ; info != NULL ; info=info->next_device) | 3579 | for (info=slgt_device_list ; info != NULL ; info=info->next_device) |
@@ -3619,7 +3616,7 @@ static int __init slgt_init(void) | |||
3619 | { | 3616 | { |
3620 | int rc; | 3617 | int rc; |
3621 | 3618 | ||
3622 | printk("%s %s\n", driver_name, driver_version); | 3619 | printk(KERN_INFO "%s\n", driver_name); |
3623 | 3620 | ||
3624 | serial_driver = alloc_tty_driver(MAX_DEVICES); | 3621 | serial_driver = alloc_tty_driver(MAX_DEVICES); |
3625 | if (!serial_driver) { | 3622 | if (!serial_driver) { |
@@ -3650,9 +3647,8 @@ static int __init slgt_init(void) | |||
3650 | goto error; | 3647 | goto error; |
3651 | } | 3648 | } |
3652 | 3649 | ||
3653 | printk("%s %s, tty major#%d\n", | 3650 | printk(KERN_INFO "%s, tty major#%d\n", |
3654 | driver_name, driver_version, | 3651 | driver_name, serial_driver->major); |
3655 | serial_driver->major); | ||
3656 | 3652 | ||
3657 | slgt_device_count = 0; | 3653 | slgt_device_count = 0; |
3658 | if ((rc = pci_register_driver(&pci_driver)) < 0) { | 3654 | if ((rc = pci_register_driver(&pci_driver)) < 0) { |
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 5a3eab0882a0..fa71b84f217b 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
@@ -475,6 +475,12 @@ void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) | |||
475 | unsigned long flags; | 475 | unsigned long flags; |
476 | 476 | ||
477 | spin_lock_irqsave(&sysrq_key_table_lock, flags); | 477 | spin_lock_irqsave(&sysrq_key_table_lock, flags); |
478 | /* | ||
479 | * Raise the apparent loglevel to maximum so that the sysrq header | ||
480 | * is shown to provide the user with positive feedback. We do not | ||
481 | * simply emit this at KERN_EMERG as that would change message | ||
482 | * routing in the consumers of /proc/kmsg. | ||
483 | */ | ||
478 | orig_log_level = console_loglevel; | 484 | orig_log_level = console_loglevel; |
479 | console_loglevel = 7; | 485 | console_loglevel = 7; |
480 | printk(KERN_INFO "SysRq : "); | 486 | printk(KERN_INFO "SysRq : "); |
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index a408c8e487ec..6f4c7d0a53bf 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c | |||
@@ -1057,7 +1057,7 @@ int tty_perform_flush(struct tty_struct *tty, unsigned long arg) | |||
1057 | if (retval) | 1057 | if (retval) |
1058 | return retval; | 1058 | return retval; |
1059 | 1059 | ||
1060 | ld = tty_ldisc_ref(tty); | 1060 | ld = tty_ldisc_ref_wait(tty); |
1061 | switch (arg) { | 1061 | switch (arg) { |
1062 | case TCIFLUSH: | 1062 | case TCIFLUSH: |
1063 | if (ld && ld->ops->flush_buffer) | 1063 | if (ld && ld->ops->flush_buffer) |