aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/nozomi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/nozomi.c')
-rw-r--r--drivers/tty/nozomi.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c
index b917c942495..a0c69ab0439 100644
--- a/drivers/tty/nozomi.c
+++ b/drivers/tty/nozomi.c
@@ -400,7 +400,7 @@ struct buffer {
400} __attribute__ ((packed)); 400} __attribute__ ((packed));
401 401
402/* Global variables */ 402/* Global variables */
403static const struct pci_device_id nozomi_pci_tbl[] __devinitconst = { 403static const struct pci_device_id nozomi_pci_tbl[] = {
404 {PCI_DEVICE(0x1931, 0x000c)}, /* Nozomi HSDPA */ 404 {PCI_DEVICE(0x1931, 0x000c)}, /* Nozomi HSDPA */
405 {}, 405 {},
406}; 406};
@@ -1360,7 +1360,7 @@ static void remove_sysfs_files(struct nozomi *dc)
1360} 1360}
1361 1361
1362/* Allocate memory for one device */ 1362/* Allocate memory for one device */
1363static int __devinit nozomi_card_init(struct pci_dev *pdev, 1363static int nozomi_card_init(struct pci_dev *pdev,
1364 const struct pci_device_id *ent) 1364 const struct pci_device_id *ent)
1365{ 1365{
1366 resource_size_t start; 1366 resource_size_t start;
@@ -1479,6 +1479,7 @@ static int __devinit nozomi_card_init(struct pci_dev *pdev,
1479 if (IS_ERR(tty_dev)) { 1479 if (IS_ERR(tty_dev)) {
1480 ret = PTR_ERR(tty_dev); 1480 ret = PTR_ERR(tty_dev);
1481 dev_err(&pdev->dev, "Could not allocate tty?\n"); 1481 dev_err(&pdev->dev, "Could not allocate tty?\n");
1482 tty_port_destroy(&port->port);
1482 goto err_free_tty; 1483 goto err_free_tty;
1483 } 1484 }
1484 } 1485 }
@@ -1486,8 +1487,10 @@ static int __devinit nozomi_card_init(struct pci_dev *pdev,
1486 return 0; 1487 return 0;
1487 1488
1488err_free_tty: 1489err_free_tty:
1489 for (i = dc->index_start; i < dc->index_start + MAX_PORT; ++i) 1490 for (i = 0; i < MAX_PORT; ++i) {
1490 tty_unregister_device(ntty_driver, i); 1491 tty_unregister_device(ntty_driver, dc->index_start + i);
1492 tty_port_destroy(&dc->port[i].port);
1493 }
1491err_free_kfifo: 1494err_free_kfifo:
1492 for (i = 0; i < MAX_PORT; i++) 1495 for (i = 0; i < MAX_PORT; i++)
1493 kfifo_free(&dc->port[i].fifo_ul); 1496 kfifo_free(&dc->port[i].fifo_ul);
@@ -1504,7 +1507,7 @@ err:
1504 return ret; 1507 return ret;
1505} 1508}
1506 1509
1507static void __devexit tty_exit(struct nozomi *dc) 1510static void tty_exit(struct nozomi *dc)
1508{ 1511{
1509 unsigned int i; 1512 unsigned int i;
1510 1513
@@ -1520,12 +1523,14 @@ static void __devexit tty_exit(struct nozomi *dc)
1520 complete off a hangup method ? */ 1523 complete off a hangup method ? */
1521 while (dc->open_ttys) 1524 while (dc->open_ttys)
1522 msleep(1); 1525 msleep(1);
1523 for (i = dc->index_start; i < dc->index_start + MAX_PORT; ++i) 1526 for (i = 0; i < MAX_PORT; ++i) {
1524 tty_unregister_device(ntty_driver, i); 1527 tty_unregister_device(ntty_driver, dc->index_start + i);
1528 tty_port_destroy(&dc->port[i].port);
1529 }
1525} 1530}
1526 1531
1527/* Deallocate memory for one device */ 1532/* Deallocate memory for one device */
1528static void __devexit nozomi_card_exit(struct pci_dev *pdev) 1533static void nozomi_card_exit(struct pci_dev *pdev)
1529{ 1534{
1530 int i; 1535 int i;
1531 struct ctrl_ul ctrl; 1536 struct ctrl_ul ctrl;
@@ -1903,7 +1908,7 @@ static struct pci_driver nozomi_driver = {
1903 .name = NOZOMI_NAME, 1908 .name = NOZOMI_NAME,
1904 .id_table = nozomi_pci_tbl, 1909 .id_table = nozomi_pci_tbl,
1905 .probe = nozomi_card_init, 1910 .probe = nozomi_card_init,
1906 .remove = __devexit_p(nozomi_card_exit), 1911 .remove = nozomi_card_exit,
1907}; 1912};
1908 1913
1909static __init int nozomi_init(void) 1914static __init int nozomi_init(void)