summaryrefslogtreecommitdiff
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2008-04-07 09:57:13 +0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 21:09:49 +0400
commit13e027a8bf2a507334fa0d30246ce619ff581cbb (patch)
tree0f10f22f8c8e7d4788b3fd8a232590ff769e7700 /drivers/media/video
parent97f26ff6049a7fff5460cebe392ad1d699dc434c (diff)
downloadlinux-13e027a8bf2a507334fa0d30246ce619ff581cbb.tar.xz
V4L/DVB (7713): pvrusb2: Implement cleaner DVB kernel thread shutdown
Earlier fix to handle DVB feed thread aborts was overly-aggressive. We can take better advantage of what kthread_stop() can do. This change simplifies things. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-dvb.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-dvb.h1
2 files changed, 1 insertions, 6 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-dvb.c b/drivers/media/video/pvrusb2/pvrusb2-dvb.c
index d82fceae4689..c20eef0f077e 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-dvb.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-dvb.c
@@ -41,7 +41,6 @@ static int pvr2_dvb_feed_func(struct pvr2_dvb_adapter *adap)
stream = adap->channel.stream->stream;
for (;;) {
- if (adap->feed_thread_stop) break;
if (kthread_should_stop()) break;
/* Not sure about this... */
@@ -76,7 +75,7 @@ static int pvr2_dvb_feed_func(struct pvr2_dvb_adapter *adap)
ret = wait_event_interruptible(
adap->buffer_wait_data,
(pvr2_stream_get_ready_count(stream) > 0) ||
- adap->feed_thread_stop);
+ kthread_should_stop());
if (ret < 0) break;
}
@@ -110,8 +109,6 @@ static void pvr2_dvb_stream_end(struct pvr2_dvb_adapter *adap)
struct pvr2_stream *stream;
if (adap->thread) {
- adap->feed_thread_stop = !0;
- pvr2_dvb_notify(adap);
kthread_stop(adap->thread);
adap->thread = NULL;
}
@@ -182,7 +179,6 @@ static int pvr2_dvb_stream_do_start(struct pvr2_dvb_adapter *adap)
if (ret < 0) return ret;
}
- adap->feed_thread_stop = 0;
adap->thread = kthread_run(pvr2_dvb_feed_thread, adap, "pvrusb2-dvb");
if (IS_ERR(adap->thread)) {
diff --git a/drivers/media/video/pvrusb2/pvrusb2-dvb.h b/drivers/media/video/pvrusb2/pvrusb2-dvb.h
index 2dd0d4ef22a2..884ff916a352 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-dvb.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-dvb.h
@@ -28,7 +28,6 @@ struct pvr2_dvb_adapter {
unsigned int stream_run:1;
wait_queue_head_t buffer_wait_data;
- int feed_thread_stop;
char *buffer_storage[PVR2_DVB_BUFFER_COUNT];
};