netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Adrian Bunk <bunk@fs.tum.de>,
	"David S. Miller" <davem@redhat.com>,
	Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@oss.sgi.com
Subject: [PATCH] fix cosa to get rid of warnings and build on SMP
Date: Thu, 4 Sep 2003 14:28:28 -0700	[thread overview]
Message-ID: <20030904142828.14218966.shemminger@osdl.org> (raw)
In-Reply-To: <20030903173417.GC18025@fs.tum.de>

* 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:

       reply	other threads:[~2003-09-04 21:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030903173417.GC18025@fs.tum.de>
2003-09-04 21:28 ` Stephen Hemminger [this message]
2003-09-05  9:43   ` [PATCH] fix cosa to get rid of warnings and build on SMP David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030904142828.14218966.shemminger@osdl.org \
    --to=shemminger@osdl.org \
    --cc=bunk@fs.tum.de \
    --cc=davem@redhat.com \
    --cc=jgarzik@pobox.com \
    --cc=netdev@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).