aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ip2
diff options
context:
space:
mode:
authorRakib Mullick <rakib.mullick@gmail.com>2009-12-09 15:34:18 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 17:43:14 -0500
commit795877cfa4a4db0982ac21e095dad9fbdc909647 (patch)
tree38b4cb5534d3efff945719a521ea4c665b59a14c /drivers/char/ip2
parentc6fc826e4c51d2c54913c2a6d800159a2c7dac4b (diff)
ip2: remove #ifdef MODULE from ip2main.c
On the kernel command line we can pass "module parameters". So #ifdef MODULE is obsolute now. Remove it completely. When CONFIG_PCI=n and building ip2main.c then we are hit by the following warning. So move *pdev into #ifdef CONFIG_PCI. drivers/char/ip2/ip2main.c: In function `ip2_loadmain': drivers/char/ip2/ip2main.c:542: warning: unused variable `pdev' Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com> Acked-by: Michael H. Warfield <mhw@WittsEnd.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char/ip2')
-rw-r--r--drivers/char/ip2/ip2main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c
index 517271c762e6..2913d05e8257 100644
--- a/drivers/char/ip2/ip2main.c
+++ b/drivers/char/ip2/ip2main.c
@@ -263,7 +263,7 @@ static int tracewrap;
263/* Macros */ 263/* Macros */
264/**********/ 264/**********/
265 265
266#if defined(MODULE) && defined(IP2DEBUG_OPEN) 266#ifdef IP2DEBUG_OPEN
267#define DBG_CNT(s) printk(KERN_DEBUG "(%s): [%x] ttyc=%d, modc=%x -> %s\n", \ 267#define DBG_CNT(s) printk(KERN_DEBUG "(%s): [%x] ttyc=%d, modc=%x -> %s\n", \
268 tty->name,(pCh->flags), \ 268 tty->name,(pCh->flags), \
269 tty->count,/*GET_USE_COUNT(module)*/0,s) 269 tty->count,/*GET_USE_COUNT(module)*/0,s)
@@ -487,7 +487,6 @@ static const struct firmware *ip2_request_firmware(void)
487 return fw; 487 return fw;
488} 488}
489 489
490#ifndef MODULE
491/****************************************************************************** 490/******************************************************************************
492 * ip2_setup: 491 * ip2_setup:
493 * str: kernel command line string 492 * str: kernel command line string
@@ -531,7 +530,6 @@ static int __init ip2_setup(char *str)
531 return 1; 530 return 1;
532} 531}
533__setup("ip2=", ip2_setup); 532__setup("ip2=", ip2_setup);
534#endif /* !MODULE */
535 533
536static int __init ip2_loadmain(void) 534static int __init ip2_loadmain(void)
537{ 535{
@@ -539,7 +537,6 @@ static int __init ip2_loadmain(void)
539 int err = 0; 537 int err = 0;
540 i2eBordStrPtr pB = NULL; 538 i2eBordStrPtr pB = NULL;
541 int rc = -1; 539 int rc = -1;
542 struct pci_dev *pdev = NULL;
543 const struct firmware *fw = NULL; 540 const struct firmware *fw = NULL;
544 541
545 if (poll_only) { 542 if (poll_only) {
@@ -612,6 +609,7 @@ static int __init ip2_loadmain(void)
612 case PCI: 609 case PCI:
613#ifdef CONFIG_PCI 610#ifdef CONFIG_PCI
614 { 611 {
612 struct pci_dev *pdev = NULL;
615 u32 addr; 613 u32 addr;
616 int status; 614 int status;
617 615
@@ -626,7 +624,7 @@ static int __init ip2_loadmain(void)
626 624
627 if (pci_enable_device(pdev)) { 625 if (pci_enable_device(pdev)) {
628 dev_err(&pdev->dev, "can't enable device\n"); 626 dev_err(&pdev->dev, "can't enable device\n");
629 break; 627 goto out;
630 } 628 }
631 ip2config.type[i] = PCI; 629 ip2config.type[i] = PCI;
632 ip2config.pci_dev[i] = pci_dev_get(pdev); 630 ip2config.pci_dev[i] = pci_dev_get(pdev);
@@ -638,6 +636,8 @@ static int __init ip2_loadmain(void)
638 dev_err(&pdev->dev, "I/O address error\n"); 636 dev_err(&pdev->dev, "I/O address error\n");
639 637
640 ip2config.irq[i] = pdev->irq; 638 ip2config.irq[i] = pdev->irq;
639out:
640 pci_dev_put(pdev);
641 } 641 }
642#else 642#else
643 printk(KERN_ERR "IP2: PCI card specified but PCI " 643 printk(KERN_ERR "IP2: PCI card specified but PCI "
@@ -656,7 +656,6 @@ static int __init ip2_loadmain(void)
656 break; 656 break;
657 } /* switch */ 657 } /* switch */
658 } /* for */ 658 } /* for */
659 pci_dev_put(pdev);
660 659
661 for (i = 0; i < IP2_MAX_BOARDS; ++i) { 660 for (i = 0; i < IP2_MAX_BOARDS; ++i) {
662 if (ip2config.addr[i]) { 661 if (ip2config.addr[i]) {