diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/char/ip2/ip2main.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/char/ip2/ip2main.c')
-rw-r--r-- | drivers/char/ip2/ip2main.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c index 517271c762e6..911e1da6def2 100644 --- a/drivers/char/ip2/ip2main.c +++ b/drivers/char/ip2/ip2main.c | |||
@@ -208,6 +208,7 @@ static int DumpFifoBuffer( char __user *, int); | |||
208 | 208 | ||
209 | static void ip2_init_board(int, const struct firmware *); | 209 | static void ip2_init_board(int, const struct firmware *); |
210 | static unsigned short find_eisa_board(int); | 210 | static unsigned short find_eisa_board(int); |
211 | static int ip2_setup(char *str); | ||
211 | 212 | ||
212 | /***************/ | 213 | /***************/ |
213 | /* Static Data */ | 214 | /* Static Data */ |
@@ -263,7 +264,7 @@ static int tracewrap; | |||
263 | /* Macros */ | 264 | /* Macros */ |
264 | /**********/ | 265 | /**********/ |
265 | 266 | ||
266 | #if defined(MODULE) && defined(IP2DEBUG_OPEN) | 267 | #ifdef IP2DEBUG_OPEN |
267 | #define DBG_CNT(s) printk(KERN_DEBUG "(%s): [%x] ttyc=%d, modc=%x -> %s\n", \ | 268 | #define DBG_CNT(s) printk(KERN_DEBUG "(%s): [%x] ttyc=%d, modc=%x -> %s\n", \ |
268 | tty->name,(pCh->flags), \ | 269 | tty->name,(pCh->flags), \ |
269 | tty->count,/*GET_USE_COUNT(module)*/0,s) | 270 | tty->count,/*GET_USE_COUNT(module)*/0,s) |
@@ -285,7 +286,10 @@ MODULE_AUTHOR("Doug McNash"); | |||
285 | MODULE_DESCRIPTION("Computone IntelliPort Plus Driver"); | 286 | MODULE_DESCRIPTION("Computone IntelliPort Plus Driver"); |
286 | MODULE_LICENSE("GPL"); | 287 | MODULE_LICENSE("GPL"); |
287 | 288 | ||
289 | #define MAX_CMD_STR 50 | ||
290 | |||
288 | static int poll_only; | 291 | static int poll_only; |
292 | static char cmd[MAX_CMD_STR]; | ||
289 | 293 | ||
290 | static int Eisa_irq; | 294 | static int Eisa_irq; |
291 | static int Eisa_slot; | 295 | static int Eisa_slot; |
@@ -309,6 +313,8 @@ module_param_array(io, int, NULL, 0); | |||
309 | MODULE_PARM_DESC(io, "I/O ports for IntelliPort Cards"); | 313 | MODULE_PARM_DESC(io, "I/O ports for IntelliPort Cards"); |
310 | module_param(poll_only, bool, 0); | 314 | module_param(poll_only, bool, 0); |
311 | MODULE_PARM_DESC(poll_only, "Do not use card interrupts"); | 315 | MODULE_PARM_DESC(poll_only, "Do not use card interrupts"); |
316 | module_param_string(ip2, cmd, MAX_CMD_STR, 0); | ||
317 | MODULE_PARM_DESC(ip2, "Contains module parameter passed with 'ip2='"); | ||
312 | 318 | ||
313 | /* for sysfs class support */ | 319 | /* for sysfs class support */ |
314 | static struct class *ip2_class; | 320 | static struct class *ip2_class; |
@@ -487,7 +493,6 @@ static const struct firmware *ip2_request_firmware(void) | |||
487 | return fw; | 493 | return fw; |
488 | } | 494 | } |
489 | 495 | ||
490 | #ifndef MODULE | ||
491 | /****************************************************************************** | 496 | /****************************************************************************** |
492 | * ip2_setup: | 497 | * ip2_setup: |
493 | * str: kernel command line string | 498 | * str: kernel command line string |
@@ -531,7 +536,6 @@ static int __init ip2_setup(char *str) | |||
531 | return 1; | 536 | return 1; |
532 | } | 537 | } |
533 | __setup("ip2=", ip2_setup); | 538 | __setup("ip2=", ip2_setup); |
534 | #endif /* !MODULE */ | ||
535 | 539 | ||
536 | static int __init ip2_loadmain(void) | 540 | static int __init ip2_loadmain(void) |
537 | { | 541 | { |
@@ -539,14 +543,20 @@ static int __init ip2_loadmain(void) | |||
539 | int err = 0; | 543 | int err = 0; |
540 | i2eBordStrPtr pB = NULL; | 544 | i2eBordStrPtr pB = NULL; |
541 | int rc = -1; | 545 | int rc = -1; |
542 | struct pci_dev *pdev = NULL; | ||
543 | const struct firmware *fw = NULL; | 546 | const struct firmware *fw = NULL; |
547 | char *str; | ||
548 | |||
549 | str = cmd; | ||
544 | 550 | ||
545 | if (poll_only) { | 551 | if (poll_only) { |
546 | /* Hard lock the interrupts to zero */ | 552 | /* Hard lock the interrupts to zero */ |
547 | irq[0] = irq[1] = irq[2] = irq[3] = poll_only = 0; | 553 | irq[0] = irq[1] = irq[2] = irq[3] = poll_only = 0; |
548 | } | 554 | } |
549 | 555 | ||
556 | /* Check module parameter with 'ip2=' has been passed or not */ | ||
557 | if (!poll_only && (!strncmp(str, "ip2=", 4))) | ||
558 | ip2_setup(str); | ||
559 | |||
550 | ip2trace(ITRC_NO_PORT, ITRC_INIT, ITRC_ENTER, 0); | 560 | ip2trace(ITRC_NO_PORT, ITRC_INIT, ITRC_ENTER, 0); |
551 | 561 | ||
552 | /* process command line arguments to modprobe or | 562 | /* process command line arguments to modprobe or |
@@ -612,6 +622,7 @@ static int __init ip2_loadmain(void) | |||
612 | case PCI: | 622 | case PCI: |
613 | #ifdef CONFIG_PCI | 623 | #ifdef CONFIG_PCI |
614 | { | 624 | { |
625 | struct pci_dev *pdev = NULL; | ||
615 | u32 addr; | 626 | u32 addr; |
616 | int status; | 627 | int status; |
617 | 628 | ||
@@ -626,7 +637,7 @@ static int __init ip2_loadmain(void) | |||
626 | 637 | ||
627 | if (pci_enable_device(pdev)) { | 638 | if (pci_enable_device(pdev)) { |
628 | dev_err(&pdev->dev, "can't enable device\n"); | 639 | dev_err(&pdev->dev, "can't enable device\n"); |
629 | break; | 640 | goto out; |
630 | } | 641 | } |
631 | ip2config.type[i] = PCI; | 642 | ip2config.type[i] = PCI; |
632 | ip2config.pci_dev[i] = pci_dev_get(pdev); | 643 | ip2config.pci_dev[i] = pci_dev_get(pdev); |
@@ -638,6 +649,8 @@ static int __init ip2_loadmain(void) | |||
638 | dev_err(&pdev->dev, "I/O address error\n"); | 649 | dev_err(&pdev->dev, "I/O address error\n"); |
639 | 650 | ||
640 | ip2config.irq[i] = pdev->irq; | 651 | ip2config.irq[i] = pdev->irq; |
652 | out: | ||
653 | pci_dev_put(pdev); | ||
641 | } | 654 | } |
642 | #else | 655 | #else |
643 | printk(KERN_ERR "IP2: PCI card specified but PCI " | 656 | printk(KERN_ERR "IP2: PCI card specified but PCI " |
@@ -656,7 +669,6 @@ static int __init ip2_loadmain(void) | |||
656 | break; | 669 | break; |
657 | } /* switch */ | 670 | } /* switch */ |
658 | } /* for */ | 671 | } /* for */ |
659 | pci_dev_put(pdev); | ||
660 | 672 | ||
661 | for (i = 0; i < IP2_MAX_BOARDS; ++i) { | 673 | for (i = 0; i < IP2_MAX_BOARDS; ++i) { |
662 | if (ip2config.addr[i]) { | 674 | if (ip2config.addr[i]) { |
@@ -3197,3 +3209,5 @@ static struct pci_device_id ip2main_pci_tbl[] __devinitdata = { | |||
3197 | }; | 3209 | }; |
3198 | 3210 | ||
3199 | MODULE_DEVICE_TABLE(pci, ip2main_pci_tbl); | 3211 | MODULE_DEVICE_TABLE(pci, ip2main_pci_tbl); |
3212 | |||
3213 | MODULE_FIRMWARE("intelliport2.bin"); | ||