* [PATCH] fix cosa to get rid of warnings and build on SMP
[not found] <20030903173417.GC18025@fs.tum.de>
@ 2003-09-04 21:28 ` Stephen Hemminger
2003-09-05 9:43 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2003-09-04 21:28 UTC (permalink / raw)
To: Adrian Bunk, David S. Miller, Jeff Garzik; +Cc: netdev
* get rid of leftover sti
* no longer need MOD_INC/DEC stuff
* get rid of dead code related to MOD_INC/DEC
* use module_init/module_exit to cleanly run init code
diff -Nru a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
--- a/drivers/net/wan/cosa.c Thu Sep 4 14:18:36 2003
+++ b/drivers/net/wan/cosa.c Thu Sep 4 14:18:36 2003
@@ -357,11 +357,7 @@
\f
/* ---------- Initialization stuff ---------- */
-#ifdef MODULE
-int init_module(void)
-#else
static int __init cosa_init(void)
-#endif
{
int i;
@@ -398,9 +394,9 @@
}
return 0;
}
+module_init(cosa_init);
-#ifdef MODULE
-void cleanup_module (void)
+static void __exit cosa_exit(void)
{
struct cosa_data *cosa;
int i;
@@ -424,7 +420,7 @@
}
unregister_chrdev(cosa_major, "cosa");
}
-#endif
+module_exit(cosa_exit);
/*
* This function should register all the net devices needed for the
@@ -513,7 +509,6 @@
if (irq < 0) {
unsigned long irqs;
/* printk(KERN_INFO "IRQ autoprobe\n"); */
- sti();
irqs = probe_irq_on();
/*
* Enable interrupt on tx buffer empty (it sure is)
@@ -624,6 +619,7 @@
if (register_netdev(d) == -1) {
printk(KERN_WARNING "%s: register_netdev failed.\n", d->name);
sppp_detach(chan->pppdev.dev);
+ free_netdev(chan->pppdev.dev);
return;
}
}
@@ -658,7 +654,6 @@
chan->rx_done = sppp_rx_done;
chan->usage=-1;
chan->cosa->usage++;
- MOD_INC_USE_COUNT;
spin_unlock_irqrestore(&chan->cosa->lock, flags);
err = sppp_open(d);
@@ -666,7 +661,6 @@
spin_lock_irqsave(&chan->cosa->lock, flags);
chan->usage=0;
chan->cosa->usage--;
- MOD_DEC_USE_COUNT;
spin_unlock_irqrestore(&chan->cosa->lock, flags);
return err;
@@ -726,7 +720,6 @@
}
chan->usage=0;
chan->cosa->usage--;
- MOD_DEC_USE_COUNT;
spin_unlock_irqrestore(&chan->cosa->lock, flags);
return 0;
}
@@ -1187,21 +1180,6 @@
return cosa_gettype(cosa, (char *)arg);
case COSAIORIDSTR:
return cosa_getidstr(cosa, (char *)arg);
-/*
- * These two are _very_ugly_hack_(tm). Don't even look at this.
- * Implementing this saved me few reboots after some process segfaulted
- * inside this module.
- */
-#ifdef MODULE
-#if 0
- case COSAIOMINC:
- MOD_INC_USE_COUNT;
- return 0;
- case COSAIOMDEC:
- MOD_DEC_USE_COUNT;
- return 0;
-#endif
-#endif
case COSAIONRCARDS:
return nr_cards;
case COSAIONRCHANS:
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fix cosa to get rid of warnings and build on SMP
2003-09-04 21:28 ` [PATCH] fix cosa to get rid of warnings and build on SMP Stephen Hemminger
@ 2003-09-05 9:43 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-09-05 9:43 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: bunk, jgarzik, netdev
On Thu, 4 Sep 2003 14:28:28 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:
> * get rid of leftover sti
> * no longer need MOD_INC/DEC stuff
> * get rid of dead code related to MOD_INC/DEC
> * use module_init/module_exit to cleanly run init code
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-09-05 9:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20030903173417.GC18025@fs.tum.de>
2003-09-04 21:28 ` [PATCH] fix cosa to get rid of warnings and build on SMP Stephen Hemminger
2003-09-05 9:43 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).