From 6414245c8fb95b7664678c441f8d84ef047d6489 Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Mon, 19 Feb 2007 15:57:38 -0800 Subject: compat: Add code to compat.h for try_to_sleep() From: Trent Piepho Compat.h used to have an argument, now it doesn't. There was also some code: if (current->flags & PF_FREEZE) { refrigerator(PF_FREEZE); } which is the same as try_to_freeze(), and so can be replaced by it. Signed-off-by: Trent Piepho --- linux/drivers/media/dvb/dvb-core/dvb_frontend.c | 6 ------ linux/drivers/media/video/msp3400-driver.c | 7 ------- linux/drivers/media/video/video-buf-dvb.c | 6 ------ linux/drivers/media/video/vivi.c | 7 ------- 4 files changed, 26 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 f39e3504d..319dccf5f 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -540,14 +540,8 @@ restart: break; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) if (try_to_freeze()) goto restart; -#else - if (current->flags & PF_FREEZE) { - refrigerator (PF_FREEZE); - } -#endif if (down_interruptible(&fepriv->sem)) break; diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index f03cc0032..159df7726 100644 --- a/linux/drivers/media/video/msp3400-driver.c +++ b/linux/drivers/media/video/msp3400-driver.c @@ -399,16 +399,9 @@ int msp_sleep(struct msp_state *state, int timeout) (msecs_to_jiffies(timeout)); } } -#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12)) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) - if (current->flags & PF_FREEZE) { - refrigerator (PF_FREEZE); - } -#endif remove_wait_queue(&state->wq, &wait); -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) try_to_freeze(); -#endif return state->restart; } diff --git a/linux/drivers/media/video/video-buf-dvb.c b/linux/drivers/media/video/video-buf-dvb.c index 86993f95a..2f730ce60 100644 --- a/linux/drivers/media/video/video-buf-dvb.c +++ b/linux/drivers/media/video/video-buf-dvb.c @@ -68,13 +68,7 @@ static int videobuf_dvb_thread(void *data) break; if (kthread_should_stop()) break; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) try_to_freeze(); -#else - if (current->flags & PF_FREEZE) { - refrigerator (PF_FREEZE); - } -#endif /* feed buffer data to demux */ if (buf->state == STATE_DONE) diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c index 798e711f4..5dd6dd096 100644 --- a/linux/drivers/media/video/vivi.c +++ b/linux/drivers/media/video/vivi.c @@ -586,16 +586,9 @@ static void vivi_sleep(struct vivi_dmaqueue *dma_q) schedule_timeout_interruptible (timeout); } -#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12)) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) - if (current->flags & PF_FREEZE) { - refrigerator (PF_FREEZE); - } -#endif remove_wait_queue(&dma_q->wq, &wait); -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) try_to_freeze(); -#endif } static int vivi_thread(void *data) -- cgit v1.2.3