From e8f530f6dc43b766d5eb2b59d39e5056e63d7f51 Mon Sep 17 00:00:00 2001 From: Holger Waechtler Date: Fri, 8 Nov 2002 22:00:11 +0000 Subject: user counter direction changed a long time ago, this screwed up the power management code. The bug never showed up so late since we disabled this feature by default... --- linux/drivers/media/dvb/dvb-core/dvb_frontend.c | 32 ++++++++++++++----------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'linux') diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c index 737d95edd..bff938203 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -420,7 +420,7 @@ int dvb_frontend_is_exiting (struct dvb_frontend_data *fe) if (fe->exit) return 1; - if (fe->dvbdev->users == 0 && dvb_shutdown_timeout) + if (fe->dvbdev->users == 1 && dvb_shutdown_timeout) if (jiffies - fe->release_jiffies > dvb_shutdown_timeout * HZ) return 1; @@ -493,19 +493,6 @@ int dvb_frontend_thread (void *data) } -static -void dvb_frontend_start (struct dvb_frontend_data *fe) -{ - dprintk ("%s\n", __FUNCTION__); - - if (!fe->exit && !fe->thread) { - if (down_interruptible (&fe->sem)) - return; - kernel_thread (dvb_frontend_thread, fe, 0); - } -} - - static void dvb_frontend_stop (struct dvb_frontend_data *fe) { @@ -521,6 +508,23 @@ void dvb_frontend_stop (struct dvb_frontend_data *fe) } +static +void dvb_frontend_start (struct dvb_frontend_data *fe) +{ + dprintk ("%s\n", __FUNCTION__); + + if (fe->thread) + dvb_frontend_stop (fe); + + if (down_interruptible (&fe->sem)) + return; + + fe->exit = 0; + + kernel_thread (dvb_frontend_thread, fe, 0); +} + + static int dvb_frontend_ioctl (struct inode *inode, struct file *file, unsigned int cmd, void *parg) -- cgit v1.2.3