diff options
author | David S. Miller <davem@davemloft.net> | 2009-06-15 06:02:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-15 06:02:23 -0400 |
commit | 9cbc1cb8cd46ce1f7645b9de249b2ce8460129bb (patch) | |
tree | 8d104ec2a459346b99413b0b77421ca7b9936c1a /drivers/serial/jsm | |
parent | ca44d6e60f9de26281fda203f58b570e1748c015 (diff) | |
parent | 45e3e1935e2857c54783291107d33323b3ef33c8 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
Documentation/feature-removal-schedule.txt
drivers/scsi/fcoe/fcoe.c
net/core/drop_monitor.c
net/core/net-traces.c
Diffstat (limited to 'drivers/serial/jsm')
-rw-r--r-- | drivers/serial/jsm/jsm.h | 1 | ||||
-rw-r--r-- | drivers/serial/jsm/jsm_tty.c | 14 |
2 files changed, 13 insertions, 2 deletions
diff --git a/drivers/serial/jsm/jsm.h b/drivers/serial/jsm/jsm.h index c0a3e2734e2..4e5f3bde046 100644 --- a/drivers/serial/jsm/jsm.h +++ b/drivers/serial/jsm/jsm.h | |||
@@ -61,6 +61,7 @@ enum { | |||
61 | if ((DBG_##nlevel & jsm_debug)) \ | 61 | if ((DBG_##nlevel & jsm_debug)) \ |
62 | dev_printk(KERN_##klevel, pdev->dev, fmt, ## args) | 62 | dev_printk(KERN_##klevel, pdev->dev, fmt, ## args) |
63 | 63 | ||
64 | #define MAXLINES 256 | ||
64 | #define MAXPORTS 8 | 65 | #define MAXPORTS 8 |
65 | #define MAX_STOPS_SENT 5 | 66 | #define MAX_STOPS_SENT 5 |
66 | 67 | ||
diff --git a/drivers/serial/jsm/jsm_tty.c b/drivers/serial/jsm/jsm_tty.c index 31496dc0a0d..107ce2e187b 100644 --- a/drivers/serial/jsm/jsm_tty.c +++ b/drivers/serial/jsm/jsm_tty.c | |||
@@ -33,6 +33,8 @@ | |||
33 | 33 | ||
34 | #include "jsm.h" | 34 | #include "jsm.h" |
35 | 35 | ||
36 | static DECLARE_BITMAP(linemap, MAXLINES); | ||
37 | |||
36 | static void jsm_carrier(struct jsm_channel *ch); | 38 | static void jsm_carrier(struct jsm_channel *ch); |
37 | 39 | ||
38 | static inline int jsm_get_mstat(struct jsm_channel *ch) | 40 | static inline int jsm_get_mstat(struct jsm_channel *ch) |
@@ -433,6 +435,7 @@ int __devinit jsm_tty_init(struct jsm_board *brd) | |||
433 | int __devinit jsm_uart_port_init(struct jsm_board *brd) | 435 | int __devinit jsm_uart_port_init(struct jsm_board *brd) |
434 | { | 436 | { |
435 | int i; | 437 | int i; |
438 | unsigned int line; | ||
436 | struct jsm_channel *ch; | 439 | struct jsm_channel *ch; |
437 | 440 | ||
438 | if (!brd) | 441 | if (!brd) |
@@ -459,9 +462,15 @@ int __devinit jsm_uart_port_init(struct jsm_board *brd) | |||
459 | brd->channels[i]->uart_port.membase = brd->re_map_membase; | 462 | brd->channels[i]->uart_port.membase = brd->re_map_membase; |
460 | brd->channels[i]->uart_port.fifosize = 16; | 463 | brd->channels[i]->uart_port.fifosize = 16; |
461 | brd->channels[i]->uart_port.ops = &jsm_ops; | 464 | brd->channels[i]->uart_port.ops = &jsm_ops; |
462 | brd->channels[i]->uart_port.line = brd->channels[i]->ch_portnum + brd->boardnum * 2; | 465 | line = find_first_zero_bit(linemap, MAXLINES); |
466 | if (line >= MAXLINES) { | ||
467 | printk(KERN_INFO "jsm: linemap is full, added device failed\n"); | ||
468 | continue; | ||
469 | } else | ||
470 | set_bit((int)line, linemap); | ||
471 | brd->channels[i]->uart_port.line = line; | ||
463 | if (uart_add_one_port (&jsm_uart_driver, &brd->channels[i]->uart_port)) | 472 | if (uart_add_one_port (&jsm_uart_driver, &brd->channels[i]->uart_port)) |
464 | printk(KERN_INFO "Added device failed\n"); | 473 | printk(KERN_INFO "jsm: add device failed\n"); |
465 | else | 474 | else |
466 | printk(KERN_INFO "Added device \n"); | 475 | printk(KERN_INFO "Added device \n"); |
467 | } | 476 | } |
@@ -494,6 +503,7 @@ int jsm_remove_uart_port(struct jsm_board *brd) | |||
494 | 503 | ||
495 | ch = brd->channels[i]; | 504 | ch = brd->channels[i]; |
496 | 505 | ||
506 | clear_bit((int)(ch->uart_port.line), linemap); | ||
497 | uart_remove_one_port(&jsm_uart_driver, &brd->channels[i]->uart_port); | 507 | uart_remove_one_port(&jsm_uart_driver, &brd->channels[i]->uart_port); |
498 | } | 508 | } |
499 | 509 | ||