Re: [PATCH] ip2: Remove #ifdef MODULE from ip2main.c

From: Andrew Morton
Date: Thu Dec 03 2009 - 23:15:30 EST


On Tue, 1 Dec 2009 15:02:56 +0600 Rakib Mullick <rakib.mullick@xxxxxxxxx> wrote:

> >From 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'

x86_64 allmodconfig:

drivers/char/ip2/ip2main.c: In function 'ip2_loadmain':
drivers/char/ip2/ip2main.c:657: error: 'pdev' undeclared (first use in this function)
drivers/char/ip2/ip2main.c:657: error: (Each undeclared identifier is reported only once
drivers/char/ip2/ip2main.c:657: error: for each function it appears in.)


I suppose this:

--- a/drivers/char/ip2/ip2main.c~ip2-remove-ifdef-module-from-ip2mainc-fix
+++ a/drivers/char/ip2/ip2main.c
@@ -636,6 +636,7 @@ static int __init ip2_loadmain(void)
dev_err(&pdev->dev, "I/O address error\n");

ip2config.irq[i] = pdev->irq;
+ pci_dev_put(pdev);
}
#else
printk(KERN_ERR "IP2: PCI card specified but PCI "
@@ -654,7 +655,6 @@ static int __init ip2_loadmain(void)
break;
} /* switch */
} /* for */
- pci_dev_put(pdev);

for (i = 0; i < IP2_MAX_BOARDS; ++i) {
if (ip2config.addr[i]) {
_

but it needs checking - does pci_get_device() need a balancing pci_dev_put()?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/