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>
This commit is contained in:
parent
c6fc826e4c
commit
795877cfa4
@ -263,7 +263,7 @@ static int tracewrap;
|
|||||||
/* Macros */
|
/* Macros */
|
||||||
/**********/
|
/**********/
|
||||||
|
|
||||||
#if defined(MODULE) && defined(IP2DEBUG_OPEN)
|
#ifdef IP2DEBUG_OPEN
|
||||||
#define DBG_CNT(s) printk(KERN_DEBUG "(%s): [%x] ttyc=%d, modc=%x -> %s\n", \
|
#define DBG_CNT(s) printk(KERN_DEBUG "(%s): [%x] ttyc=%d, modc=%x -> %s\n", \
|
||||||
tty->name,(pCh->flags), \
|
tty->name,(pCh->flags), \
|
||||||
tty->count,/*GET_USE_COUNT(module)*/0,s)
|
tty->count,/*GET_USE_COUNT(module)*/0,s)
|
||||||
@ -487,7 +487,6 @@ static const struct firmware *ip2_request_firmware(void)
|
|||||||
return fw;
|
return fw;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MODULE
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* ip2_setup:
|
* ip2_setup:
|
||||||
* str: kernel command line string
|
* str: kernel command line string
|
||||||
@ -531,7 +530,6 @@ static int __init ip2_setup(char *str)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
__setup("ip2=", ip2_setup);
|
__setup("ip2=", ip2_setup);
|
||||||
#endif /* !MODULE */
|
|
||||||
|
|
||||||
static int __init ip2_loadmain(void)
|
static int __init ip2_loadmain(void)
|
||||||
{
|
{
|
||||||
@ -539,7 +537,6 @@ static int __init ip2_loadmain(void)
|
|||||||
int err = 0;
|
int err = 0;
|
||||||
i2eBordStrPtr pB = NULL;
|
i2eBordStrPtr pB = NULL;
|
||||||
int rc = -1;
|
int rc = -1;
|
||||||
struct pci_dev *pdev = NULL;
|
|
||||||
const struct firmware *fw = NULL;
|
const struct firmware *fw = NULL;
|
||||||
|
|
||||||
if (poll_only) {
|
if (poll_only) {
|
||||||
@ -612,6 +609,7 @@ static int __init ip2_loadmain(void)
|
|||||||
case PCI:
|
case PCI:
|
||||||
#ifdef CONFIG_PCI
|
#ifdef CONFIG_PCI
|
||||||
{
|
{
|
||||||
|
struct pci_dev *pdev = NULL;
|
||||||
u32 addr;
|
u32 addr;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
@ -626,7 +624,7 @@ static int __init ip2_loadmain(void)
|
|||||||
|
|
||||||
if (pci_enable_device(pdev)) {
|
if (pci_enable_device(pdev)) {
|
||||||
dev_err(&pdev->dev, "can't enable device\n");
|
dev_err(&pdev->dev, "can't enable device\n");
|
||||||
break;
|
goto out;
|
||||||
}
|
}
|
||||||
ip2config.type[i] = PCI;
|
ip2config.type[i] = PCI;
|
||||||
ip2config.pci_dev[i] = pci_dev_get(pdev);
|
ip2config.pci_dev[i] = pci_dev_get(pdev);
|
||||||
@ -638,6 +636,8 @@ static int __init ip2_loadmain(void)
|
|||||||
dev_err(&pdev->dev, "I/O address error\n");
|
dev_err(&pdev->dev, "I/O address error\n");
|
||||||
|
|
||||||
ip2config.irq[i] = pdev->irq;
|
ip2config.irq[i] = pdev->irq;
|
||||||
|
out:
|
||||||
|
pci_dev_put(pdev);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
printk(KERN_ERR "IP2: PCI card specified but PCI "
|
printk(KERN_ERR "IP2: PCI card specified but PCI "
|
||||||
@ -656,7 +656,6 @@ static int __init ip2_loadmain(void)
|
|||||||
break;
|
break;
|
||||||
} /* switch */
|
} /* switch */
|
||||||
} /* for */
|
} /* for */
|
||||||
pci_dev_put(pdev);
|
|
||||||
|
|
||||||
for (i = 0; i < IP2_MAX_BOARDS; ++i) {
|
for (i = 0; i < IP2_MAX_BOARDS; ++i) {
|
||||||
if (ip2config.addr[i]) {
|
if (ip2config.addr[i]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user