netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: netdev@oss.sgi.com
Subject: [PATCH] switch skfp over to initcalls
Date: Wed, 4 Jun 2003 20:18:09 +0200	[thread overview]
Message-ID: <20030604181809.GA24779@lst.de> (raw)

This is a PCI driver and has no business in Space.c.  Also
allows to kill all the fddi code in there (and the stale
reference to the long gone apfddi driver)


--- 1.20/drivers/net/Space.c	Wed May 21 03:56:26 2003
+++ edited/drivers/net/Space.c	Tue Jun  3 22:17:09 2003
@@ -105,9 +105,6 @@
 /* Detachable devices ("pocket adaptors") */
 extern int de620_probe(struct net_device *);
 
-/* FDDI adapters */
-extern int skfp_probe(struct net_device *dev);
-
 /* Fibre Channel adapters */
 extern int iph5526_probe(struct net_device *dev);
 
@@ -401,29 +398,6 @@
 	return -ENODEV;
 }
 
-#ifdef CONFIG_FDDI
-static int __init fddiif_probe(struct net_device *dev)
-{
-    unsigned long base_addr = dev->base_addr;
-
-    if (base_addr == 1)
-	    return 1;		/* ENXIO */
-
-    if (1
-#ifdef CONFIG_APFDDI
-	&& apfddi_init(dev)
-#endif
-#ifdef CONFIG_SKFP
-	&& skfp_probe(dev)
-#endif
-	&& 1 ) {
-	    return 1;	/* -ENODEV or -EAGAIN would be more accurate. */
-    }
-    return 0;
-}
-#endif
-
-
 #ifdef CONFIG_NET_FC
 static int fcif_probe(struct net_device *dev)
 {
@@ -614,52 +588,6 @@
 #define      NEXT_DEV        (&tr0_dev)
 
 #endif 
-
-#ifdef CONFIG_FDDI
-static struct net_device fddi7_dev = {
-	.name		= "fddi7",
-	.next		=  NEXT_DEV,
-	.init		= fddiif_probe
-};
-static struct net_device fddi6_dev = {
-	.name		= "fddi6",
-	.next		= &fddi7_dev,
-	.init		= fddiif_probe
-};
-static struct net_device fddi5_dev = {
-	.name		= "fddi5",
-	.next		= &fddi6_dev,
-	.init		= fddiif_probe
-};
-static struct net_device fddi4_dev = {
-	.name		= "fddi4",
-	.next		= &fddi5_dev,
-	.init		= fddiif_probe
-};
-static struct net_device fddi3_dev = {
-	.name		= "fddi3",
-	.next		= &fddi4_dev,
-	.init		= fddiif_probe
-};
-static struct net_device fddi2_dev = {
-	.name		= "fddi2",
-	.next		= &fddi3_dev,
-	.init		= fddiif_probe
-};
-static struct net_device fddi1_dev = {
-	.name		= "fddi1",
-	.next		= &fddi2_dev,
-	.init		= fddiif_probe
-};
-static struct net_device fddi0_dev = {
-	.name		= "fddi0",
-	.next		= &fddi1_dev,
-	.init		= fddiif_probe
-};
-#undef	NEXT_DEV
-#define	NEXT_DEV	(&fddi0_dev)
-#endif 
-
 
 #ifdef CONFIG_NET_FC
 static struct net_device fc1_dev = {
--- 1.12/drivers/net/skfp/skfddi.c	Fri May  9 02:40:17 2003
+++ edited/drivers/net/skfp/skfddi.c	Tue Jun  3 22:19:04 2003
@@ -2539,72 +2539,25 @@
 }				// drv_reset_indication
 
 
-
-//--------------- functions for use as a module ----------------
-
-#ifdef MODULE
-/************************
- *
- * Note now that module autoprobing is allowed under PCI. The
- * IRQ lines will not be auto-detected; instead I'll rely on the BIOSes
- * to "do the right thing".
- *
- ************************/
-#define LP(a) ((struct s_smc*)(a))
 static struct net_device *mdev;
 
-/************************
- *
- * init_module
- *
- *  If compiled as a module, find
- *  adapters and initialize them.
- *
- ************************/
-int init_module(void)
+static int __init skfd_init(void)
 {
 	struct net_device *p;
 
-	PRINTK(KERN_INFO "FDDI init module\n");
 	if ((mdev = insert_device(NULL, skfp_probe)) == NULL)
 		return -ENOMEM;
 
-	for (p = mdev; p != NULL; p = LP(p->priv)->os.next_module) {
-		PRINTK(KERN_INFO "device to register: %s\n", p->name);
+	for (p = mdev; p != NULL; p = ((struct s_smc *)p->priv)->os.next_module) {
 		if (register_netdev(p) != 0) {
 			printk("skfddi init_module failed\n");
 			return -EIO;
 		}
 	}
 
-	PRINTK(KERN_INFO "+++++ exit with success +++++\n");
 	return 0;
-}				// init_module
+}
 
-/************************
- *
- * cleanup_module
- *
- *  Release all resources claimed by this module.
- *
- ************************/
-void cleanup_module(void)
-{
-	PRINTK(KERN_INFO "cleanup_module\n");
-	while (mdev != NULL) {
-		mdev = unlink_modules(mdev);
-	}
-	return;
-}				// cleanup_module
-
-
-/************************
- *
- * unlink_modules
- *
- *  Unregister devices and release their memory.
- *
- ************************/
 static struct net_device *unlink_modules(struct net_device *p)
 {
 	struct net_device *next = NULL;
@@ -2638,5 +2591,11 @@
 	return next;
 }				// unlink_modules
 
+static void __exit skfd_exit(void)
+{
+	while (mdev)
+		mdev = unlink_modules(mdev);
+}
 
-#endif				/* MODULE */
+module_init(skfd_init);
+module_exit(skfd_exit);

             reply	other threads:[~2003-06-04 18:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-04 18:18 Christoph Hellwig [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-06-09 12:06 [PATCH] switch skfp over to initcalls Christoph Hellwig
2003-06-09 16:51 ` 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=20030604181809.GA24779@lst.de \
    --to=hch@lst.de \
    --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).