patch-2.4.0-test12 linux/drivers/net/wan/sdlamain.c

Next file: linux/drivers/net/wan/x25_asy.h
Previous file: linux/drivers/net/wan/comx.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test11/linux/drivers/net/wan/sdlamain.c linux/drivers/net/wan/sdlamain.c
@@ -106,14 +106,7 @@
 static sdla_t* card_array;	/* adapter data space */
 
 /* Task queue element for creating a 'thread' */
-static struct tq_struct sdla_tq =
-{
-	NULL,		/* .next */
-	0,		/* .sync */
-	&sdla_poll,	/* .routine */
-	NULL		/* .data */
-}; 
-
+static struct tq_struct sdla_tq = { routine: sdla_poll };
 
 /******* Kernel Loadable Module Entry Points ********************************/
 
@@ -480,8 +473,11 @@
         if(card->hw.type != SDLA_S514 && !card->wandev.piggyback)
                 request_region(card->hw.port, card->hw.io_range, wandev->name);
 
-	if (++active == 1)
-		queue_task(&sdla_tq, &tq_scheduler);
+	if (++active == 1) {
+		MOD_INC_USE_COUNT;
+		if (schedule_task(&sdla_tq) == 0)
+			MOD_DEC_USE_COUNT;
+	}
 		
 	wandev->critical = 0;
 	return 0;
@@ -859,8 +855,12 @@
 			card->poll(card);
 		}
 	}
-	if (active)
-		queue_task(&sdla_tq, &tq_scheduler);
+	if (active) {
+		MOD_INC_USE_COUNT;
+		if (schedule_task(&sdla_tq) == 0)	/* Surely not? */
+			MOD_DEC_USE_COUNT;
+	}
+	MOD_DEC_USE_COUNT;
 }
 
 /*============================================================================

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)