From c753e6c0e69454b99f32da5e5fd38794418d48c8 Mon Sep 17 00:00:00 2001 From: Holger Waechtler Date: Fri, 13 Jun 2003 18:30:31 +0000 Subject: use tq_schedule instead of tq_immediate --- linux/drivers/media/dvb/dvb-core/dvb_net.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/linux/drivers/media/dvb/dvb-core/dvb_net.c b/linux/drivers/media/dvb/dvb-core/dvb_net.c index 529ba27b5..d9472a030 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_net.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_net.c @@ -347,7 +347,7 @@ static void dvb_net_set_multicast_list (struct net_device *dev) { struct dvb_net_priv *priv = (struct dvb_net_priv*) dev->priv; - queue_task(&priv->tq, &tq_immediate); + schedule_task(&priv->tq); } @@ -488,10 +488,22 @@ int dvb_net_add_if(struct dvb_net *dvbnet, u16 pid) static int dvb_net_remove_if(struct dvb_net *dvbnet, int num) { + struct dvb_net_priv *priv = dvbnet->device[num].priv; + unsigned long flags; + if (!dvbnet->state[num]) return -EINVAL; + + /** + * remove tq from task queue if it was scheduled before... + */ + spin_lock_irqsave(&tqueue_lock, flags); + if (test_bit(0, &priv->tq.sync)) + list_del(&priv->tq.list); + spin_unlock_irqrestore(&tqueue_lock, flags); + dvb_net_stop(&dvbnet->device[num]); - kfree(dvbnet->device[num].priv); + kfree(priv); unregister_netdev(&dvbnet->device[num]); dvbnet->state[num]=0; return 0; -- cgit v1.2.3