Skip to contentSkip to conversation

ibmtr -- convert to new probeing

PATCH In review Stephen Hemminger 2 participants 2 messages Nov 13, 2003 – Nov 15, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ibmtr -- convert to new probeing

This patch applies against net-drivers-2.5-exp. The line number offsets assume the earlier patchset, but this change doesn't overlap all those ether changes.

* convert ibmtr driver to using the new probe interface -- ibmtr_probe2
* keep old ibmtr_probe for use as init handle because ibmtr_cs uses it
* cleanup error paths in ibmtr_probe1 and module init
* make only used locally functions static
* do request_region before doing i/o
* irq and mem were not really settable as module parameters so removed

drivers/net/Space.c +7 -29
diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c
@@ -336,12 +336,15 @@
 
 #ifdef CONFIG_TR
 /* Token-ring device probe */
-extern int ibmtr_probe(struct net_device *);
+extern struct net_device *ibmtr_probe2(int unit);
 extern struct net_device *sk_isa_probe(int unit);
 extern struct net_device *proteon_probe(int unit);
 extern struct net_device *smctr_probe(int unit);
 
-static struct devprobe2 tr_probes2[] __initdata = {
+static struct devprobe2 tr_probes[] __initdata = {
+#ifdef CONFIG_IBMTR
+	{ibmtr_probe2, 0},
+#endif
 #ifdef CONFIG_SKISA
 	{sk_isa_probe, 0},
 #endif
@@ -354,37 +357,13 @@
 	{NULL, 0},
 };
 
-static __init int trif_probe(int unit)
-{
-	struct net_device *dev;
-	int err = -ENODEV;
-	
-	dev = alloc_trdev(0);
-	if (!dev)
-		return -ENOMEM;
-
-	sprintf(dev->name, "tr%d", unit);
-	netdev_boot_setup_check(dev);
-	if (
-#ifdef CONFIG_IBMTR
-	    ibmtr_probe(dev) == 0  ||
-#endif
-	    0 ) 
-		err = register_netdev(dev);
-		
-	if (err)
-		free_netdev(dev);
-	return err;
-
-}
-
 static void __init trif_probe2(int unit)
 {
 	unsigned long base_addr = netdev_boot_base("tr", unit);
 
 	if (base_addr == 1)
 		return;
-	probe_list2(unit, tr_probes2, base_addr == 0);
+	probe_list2(unit, tr_probes, base_addr == 0);
 }
 #endif
 
@@ -411,8 +390,7 @@
 #endif
 #ifdef CONFIG_TR
 	for (num = 0; num < 8; ++num)
-		if (!trif_probe(num))
-			trif_probe2(num);
+		trif_probe2(num);
 #endif
 	for (num = 0; num < 8; ++num)
 		ethif_probe2(num);
drivers/net/tokenring/ibmtr.c +84 -63

280 lines not on this page · raw message

#1 lore raw
Quoted 9 lines · Stephen Hemminger

This patch applies against net-drivers-2.5-exp. The line number offsets assume the earlier patchset, but this change doesn't overlap all those ether changes.

* convert ibmtr driver to using the new probe interface -- ibmtr_probe2
* keep old ibmtr_probe for use as init handle because ibmtr_cs uses it
* cleanup error paths in ibmtr_probe1 and module init
* make only used locally functions static
* do request_region before doing i/o
* irq and mem were not really settable as module parameters so removed

Given that there has been some other activity in this driver, I would prefer to wait for Mike's ACK, before applying to net-drivers-2.5-exp (and eventually 2.6 when it re-opens).

Jeff