Commit 954bd821 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] make ewrk3/depca work again

parent a1ac7138
...@@ -463,8 +463,6 @@ static int load_packet(struct net_device *dev, struct sk_buff *skb); ...@@ -463,8 +463,6 @@ static int load_packet(struct net_device *dev, struct sk_buff *skb);
static void depca_dbg_open(struct net_device *dev); static void depca_dbg_open(struct net_device *dev);
#ifdef MODULE #ifdef MODULE
int init_module(void);
void cleanup_module(void);
static int autoprobed = 1, loading_module = 1; static int autoprobed = 1, loading_module = 1;
# else # else
static u_char de1xx_irq[] __initdata = { 2, 3, 4, 5, 7, 9, 0 }; static u_char de1xx_irq[] __initdata = { 2, 3, 4, 5, 7, 9, 0 };
......
...@@ -332,8 +332,6 @@ static struct net_device *insert_device(struct net_device *dev, u_long iobase, i ...@@ -332,8 +332,6 @@ static struct net_device *insert_device(struct net_device *dev, u_long iobase, i
#ifdef MODULE #ifdef MODULE
int init_module(void);
void cleanup_module(void);
static int autoprobed = 1, loading_module = 1; static int autoprobed = 1, loading_module = 1;
#else #else
...@@ -2083,7 +2081,25 @@ MODULE_PARM(irq, "0-21i"); ...@@ -2083,7 +2081,25 @@ MODULE_PARM(irq, "0-21i");
MODULE_PARM_DESC(io, "EtherWORKS 3 I/O base address(es)"); MODULE_PARM_DESC(io, "EtherWORKS 3 I/O base address(es)");
MODULE_PARM_DESC(irq, "EtherWORKS 3 IRQ number(s)"); MODULE_PARM_DESC(irq, "EtherWORKS 3 IRQ number(s)");
int init_module(void) static void ewrk3_exit_module(void)
{
int i;
for( i=0; i<ndevs; i++ ) {
unregister_netdev(ewrk3_devs[i]);
if (ewrk3_devs[i]->priv) {
kfree(ewrk3_devs[i]->priv);
ewrk3_devs[i]->priv = NULL;
}
ewrk3_devs[i]->irq = 0;
release_region(ewrk3_devs[i]->base_addr, EWRK3_TOTAL_SIZE);
kfree(ewrk3_devs[i]);
ewrk3_devs[i] = NULL;
}
}
static int ewrk3_init_module(void)
{ {
int i=0; int i=0;
...@@ -2107,27 +2123,14 @@ int init_module(void) ...@@ -2107,27 +2123,14 @@ int init_module(void)
return ndevs ? 0 : -EIO; return ndevs ? 0 : -EIO;
error: error:
cleanup_module(); ewrk3_exit_module();
return -ENOMEM; return -ENOMEM;
} }
void cleanup_module(void)
{
int i;
for( i=0; i<ndevs; i++ ) {
unregister_netdev(ewrk3_devs[i]);
if (ewrk3_devs[i]->priv) {
kfree(ewrk3_devs[i]->priv);
ewrk3_devs[i]->priv = NULL;
}
ewrk3_devs[i]->irq = 0;
release_region(ewrk3_devs[i]->base_addr, EWRK3_TOTAL_SIZE); /* Hack for breakage in new module stuff */
kfree(ewrk3_devs[i]); module_exit(ewrk3_exit_module);
ewrk3_devs[i] = NULL; module_init(ewrk3_init_module);
}
}
#endif /* MODULE */ #endif /* MODULE */
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
......
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