Commit 64916f1e authored by Denis Vlasenko's avatar Denis Vlasenko Committed by Jeff Garzik

[PATCH] fix a few "warning: 'cleanup_card' defined but not used"

These warnings are emitted if non-modular network drivers are built.
Fixes just move cleanup_card() definitions into #ifdef MODULE region.

/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/wd.c:131: warning: 'cleanup_card' defined but not used
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/3c503.c:152: warning: 'cleanup_card' defined but not used
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/ne.c:216: warning: 'cleanup_card' defined but not used
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/hp.c:106: warning: 'cleanup_card' defined but not used
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/hp-plus.c:142: warning: 'cleanup_card' defined but not used
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/smc-ultra.c:172: warning: 'cleanup_card' defined but not used
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/e2100.c:144: warning: 'cleanup_card' defined but not used
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/es3210.c:159: warning: 'cleanup_card' defined but not used
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/lne390.c:149: warning: 'cleanup_card' defined but not used
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/lance.c:313: warning: 'cleanup_card' defined but not used
/.1/usr/srcdevel/kernel/linux-2.6.15-rc7.src/drivers/net/ac3200.c:127: warning: 'cleanup_card' defined but not used
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent fa45459e
...@@ -148,14 +148,6 @@ el2_pio_probe(struct net_device *dev) ...@@ -148,14 +148,6 @@ el2_pio_probe(struct net_device *dev)
return -ENODEV; return -ENODEV;
} }
static void cleanup_card(struct net_device *dev)
{
/* NB: el2_close() handles free_irq */
release_region(dev->base_addr, EL2_IO_EXTENT);
if (ei_status.mem)
iounmap(ei_status.mem);
}
#ifndef MODULE #ifndef MODULE
struct net_device * __init el2_probe(int unit) struct net_device * __init el2_probe(int unit)
{ {
...@@ -726,6 +718,14 @@ init_module(void) ...@@ -726,6 +718,14 @@ init_module(void)
return -ENXIO; return -ENXIO;
} }
static void cleanup_card(struct net_device *dev)
{
/* NB: el2_close() handles free_irq */
release_region(dev->base_addr, EL2_IO_EXTENT);
if (ei_status.mem)
iounmap(ei_status.mem);
}
void void
cleanup_module(void) cleanup_module(void)
{ {
......
...@@ -123,14 +123,6 @@ static int __init do_ac3200_probe(struct net_device *dev) ...@@ -123,14 +123,6 @@ static int __init do_ac3200_probe(struct net_device *dev)
return -ENODEV; return -ENODEV;
} }
static void cleanup_card(struct net_device *dev)
{
/* Someday free_irq may be in ac_close_card() */
free_irq(dev->irq, dev);
release_region(dev->base_addr, AC_IO_EXTENT);
iounmap(ei_status.mem);
}
#ifndef MODULE #ifndef MODULE
struct net_device * __init ac3200_probe(int unit) struct net_device * __init ac3200_probe(int unit)
{ {
...@@ -406,6 +398,14 @@ init_module(void) ...@@ -406,6 +398,14 @@ init_module(void)
return -ENXIO; return -ENXIO;
} }
static void cleanup_card(struct net_device *dev)
{
/* Someday free_irq may be in ac_close_card() */
free_irq(dev->irq, dev);
release_region(dev->base_addr, AC_IO_EXTENT);
iounmap(ei_status.mem);
}
void void
cleanup_module(void) cleanup_module(void)
{ {
......
...@@ -140,13 +140,6 @@ static int __init do_e2100_probe(struct net_device *dev) ...@@ -140,13 +140,6 @@ static int __init do_e2100_probe(struct net_device *dev)
return -ENODEV; return -ENODEV;
} }
static void cleanup_card(struct net_device *dev)
{
/* NB: e21_close() handles free_irq */
iounmap(ei_status.mem);
release_region(dev->base_addr, E21_IO_EXTENT);
}
#ifndef MODULE #ifndef MODULE
struct net_device * __init e2100_probe(int unit) struct net_device * __init e2100_probe(int unit)
{ {
...@@ -463,6 +456,13 @@ init_module(void) ...@@ -463,6 +456,13 @@ init_module(void)
return -ENXIO; return -ENXIO;
} }
static void cleanup_card(struct net_device *dev)
{
/* NB: e21_close() handles free_irq */
iounmap(ei_status.mem);
release_region(dev->base_addr, E21_IO_EXTENT);
}
void void
cleanup_module(void) cleanup_module(void)
{ {
......
...@@ -155,13 +155,6 @@ static int __init do_es_probe(struct net_device *dev) ...@@ -155,13 +155,6 @@ static int __init do_es_probe(struct net_device *dev)
return -ENODEV; return -ENODEV;
} }
static void cleanup_card(struct net_device *dev)
{
free_irq(dev->irq, dev);
release_region(dev->base_addr, ES_IO_EXTENT);
iounmap(ei_status.mem);
}
#ifndef MODULE #ifndef MODULE
struct net_device * __init es_probe(int unit) struct net_device * __init es_probe(int unit)
{ {
...@@ -456,6 +449,13 @@ init_module(void) ...@@ -456,6 +449,13 @@ init_module(void)
return -ENXIO; return -ENXIO;
} }
static void cleanup_card(struct net_device *dev)
{
free_irq(dev->irq, dev);
release_region(dev->base_addr, ES_IO_EXTENT);
iounmap(ei_status.mem);
}
void void
cleanup_module(void) cleanup_module(void)
{ {
......
...@@ -138,12 +138,6 @@ static int __init do_hpp_probe(struct net_device *dev) ...@@ -138,12 +138,6 @@ static int __init do_hpp_probe(struct net_device *dev)
return -ENODEV; return -ENODEV;
} }
static void cleanup_card(struct net_device *dev)
{
/* NB: hpp_close() handles free_irq */
release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
}
#ifndef MODULE #ifndef MODULE
struct net_device * __init hp_plus_probe(int unit) struct net_device * __init hp_plus_probe(int unit)
{ {
...@@ -473,6 +467,12 @@ init_module(void) ...@@ -473,6 +467,12 @@ init_module(void)
return -ENXIO; return -ENXIO;
} }
static void cleanup_card(struct net_device *dev)
{
/* NB: hpp_close() handles free_irq */
release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
}
void void
cleanup_module(void) cleanup_module(void)
{ {
......
...@@ -102,12 +102,6 @@ static int __init do_hp_probe(struct net_device *dev) ...@@ -102,12 +102,6 @@ static int __init do_hp_probe(struct net_device *dev)
return -ENODEV; return -ENODEV;
} }
static void cleanup_card(struct net_device *dev)
{
free_irq(dev->irq, dev);
release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
}
#ifndef MODULE #ifndef MODULE
struct net_device * __init hp_probe(int unit) struct net_device * __init hp_probe(int unit)
{ {
...@@ -444,6 +438,12 @@ init_module(void) ...@@ -444,6 +438,12 @@ init_module(void)
return -ENXIO; return -ENXIO;
} }
static void cleanup_card(struct net_device *dev)
{
free_irq(dev->irq, dev);
release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
}
void void
cleanup_module(void) cleanup_module(void)
{ {
......
...@@ -309,17 +309,6 @@ static void lance_tx_timeout (struct net_device *dev); ...@@ -309,17 +309,6 @@ static void lance_tx_timeout (struct net_device *dev);
static void cleanup_card(struct net_device *dev)
{
struct lance_private *lp = dev->priv;
if (dev->dma != 4)
free_dma(dev->dma);
release_region(dev->base_addr, LANCE_TOTAL_SIZE);
kfree(lp->tx_bounce_buffs);
kfree((void*)lp->rx_buffs);
kfree(lp);
}
#ifdef MODULE #ifdef MODULE
#define MAX_CARDS 8 /* Max number of interfaces (cards) per module */ #define MAX_CARDS 8 /* Max number of interfaces (cards) per module */
...@@ -367,6 +356,17 @@ int init_module(void) ...@@ -367,6 +356,17 @@ int init_module(void)
return -ENXIO; return -ENXIO;
} }
static void cleanup_card(struct net_device *dev)
{
struct lance_private *lp = dev->priv;
if (dev->dma != 4)
free_dma(dev->dma);
release_region(dev->base_addr, LANCE_TOTAL_SIZE);
kfree(lp->tx_bounce_buffs);
kfree((void*)lp->rx_buffs);
kfree(lp);
}
void cleanup_module(void) void cleanup_module(void)
{ {
int this_dev; int this_dev;
......
...@@ -145,13 +145,6 @@ static int __init do_lne390_probe(struct net_device *dev) ...@@ -145,13 +145,6 @@ static int __init do_lne390_probe(struct net_device *dev)
return -ENODEV; return -ENODEV;
} }
static void cleanup_card(struct net_device *dev)
{
free_irq(dev->irq, dev);
release_region(dev->base_addr, LNE390_IO_EXTENT);
iounmap(ei_status.mem);
}
#ifndef MODULE #ifndef MODULE
struct net_device * __init lne390_probe(int unit) struct net_device * __init lne390_probe(int unit)
{ {
...@@ -440,6 +433,13 @@ int init_module(void) ...@@ -440,6 +433,13 @@ int init_module(void)
return -ENXIO; return -ENXIO;
} }
static void cleanup_card(struct net_device *dev)
{
free_irq(dev->irq, dev);
release_region(dev->base_addr, LNE390_IO_EXTENT);
iounmap(ei_status.mem);
}
void cleanup_module(void) void cleanup_module(void)
{ {
int this_dev; int this_dev;
......
...@@ -212,15 +212,6 @@ static int __init do_ne_probe(struct net_device *dev) ...@@ -212,15 +212,6 @@ static int __init do_ne_probe(struct net_device *dev)
return -ENODEV; return -ENODEV;
} }
static void cleanup_card(struct net_device *dev)
{
struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
if (idev)
pnp_device_detach(idev);
free_irq(dev->irq, dev);
release_region(dev->base_addr, NE_IO_EXTENT);
}
#ifndef MODULE #ifndef MODULE
struct net_device * __init ne_probe(int unit) struct net_device * __init ne_probe(int unit)
{ {
...@@ -859,6 +850,15 @@ int init_module(void) ...@@ -859,6 +850,15 @@ int init_module(void)
return -ENODEV; return -ENODEV;
} }
static void cleanup_card(struct net_device *dev)
{
struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
if (idev)
pnp_device_detach(idev);
free_irq(dev->irq, dev);
release_region(dev->base_addr, NE_IO_EXTENT);
}
void cleanup_module(void) void cleanup_module(void)
{ {
int this_dev; int this_dev;
......
...@@ -278,14 +278,6 @@ static int __init do_ne2_probe(struct net_device *dev) ...@@ -278,14 +278,6 @@ static int __init do_ne2_probe(struct net_device *dev)
return -ENODEV; return -ENODEV;
} }
static void cleanup_card(struct net_device *dev)
{
mca_mark_as_unused(ei_status.priv);
mca_set_adapter_procfn( ei_status.priv, NULL, NULL);
free_irq(dev->irq, dev);
release_region(dev->base_addr, NE_IO_EXTENT);
}
#ifndef MODULE #ifndef MODULE
struct net_device * __init ne2_probe(int unit) struct net_device * __init ne2_probe(int unit)
{ {
...@@ -812,6 +804,14 @@ int init_module(void) ...@@ -812,6 +804,14 @@ int init_module(void)
return -ENXIO; return -ENXIO;
} }
static void cleanup_card(struct net_device *dev)
{
mca_mark_as_unused(ei_status.priv);
mca_set_adapter_procfn( ei_status.priv, NULL, NULL);
free_irq(dev->irq, dev);
release_region(dev->base_addr, NE_IO_EXTENT);
}
void cleanup_module(void) void cleanup_module(void)
{ {
int this_dev; int this_dev;
......
...@@ -168,18 +168,6 @@ static int __init do_ultra_probe(struct net_device *dev) ...@@ -168,18 +168,6 @@ static int __init do_ultra_probe(struct net_device *dev)
return -ENODEV; return -ENODEV;
} }
static void cleanup_card(struct net_device *dev)
{
/* NB: ultra_close_card() does free_irq */
#ifdef __ISAPNP__
struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
if (idev)
pnp_device_detach(idev);
#endif
release_region(dev->base_addr - ULTRA_NIC_OFFSET, ULTRA_IO_EXTENT);
iounmap(ei_status.mem);
}
#ifndef MODULE #ifndef MODULE
struct net_device * __init ultra_probe(int unit) struct net_device * __init ultra_probe(int unit)
{ {
...@@ -594,6 +582,18 @@ init_module(void) ...@@ -594,6 +582,18 @@ init_module(void)
return -ENXIO; return -ENXIO;
} }
static void cleanup_card(struct net_device *dev)
{
/* NB: ultra_close_card() does free_irq */
#ifdef __ISAPNP__
struct pnp_dev *idev = (struct pnp_dev *)ei_status.priv;
if (idev)
pnp_device_detach(idev);
#endif
release_region(dev->base_addr - ULTRA_NIC_OFFSET, ULTRA_IO_EXTENT);
iounmap(ei_status.mem);
}
void void
cleanup_module(void) cleanup_module(void)
{ {
......
...@@ -127,13 +127,6 @@ static int __init do_wd_probe(struct net_device *dev) ...@@ -127,13 +127,6 @@ static int __init do_wd_probe(struct net_device *dev)
return -ENODEV; return -ENODEV;
} }
static void cleanup_card(struct net_device *dev)
{
free_irq(dev->irq, dev);
release_region(dev->base_addr - WD_NIC_OFFSET, WD_IO_EXTENT);
iounmap(ei_status.mem);
}
#ifndef MODULE #ifndef MODULE
struct net_device * __init wd_probe(int unit) struct net_device * __init wd_probe(int unit)
{ {
...@@ -538,6 +531,13 @@ init_module(void) ...@@ -538,6 +531,13 @@ init_module(void)
return -ENXIO; return -ENXIO;
} }
static void cleanup_card(struct net_device *dev)
{
free_irq(dev->irq, dev);
release_region(dev->base_addr - WD_NIC_OFFSET, WD_IO_EXTENT);
iounmap(ei_status.mem);
}
void void
cleanup_module(void) cleanup_module(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment