summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/pvrusb2
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2008-04-06 21:57:13 -0500
committerMike Isely <isely@pobox.com>2008-04-06 21:57:13 -0500
commitcc47ad63d90e229ca6e286443e8b3b8d4a330f14 (patch)
tree1cae8440cf023a05693ea1be4fa44e1e00d432c1 /linux/drivers/media/video/pvrusb2
parentdf054b4ba9e38717e792e7aa0cfc2be8a68b5529 (diff)
downloadmediapointer-dvb-s2-cc47ad63d90e229ca6e286443e8b3b8d4a330f14.tar.gz
mediapointer-dvb-s2-cc47ad63d90e229ca6e286443e8b3b8d4a330f14.tar.bz2
pvrusb2: Implement cleaner DVB kernel thread shutdown
From: Mike Isely <isely@pobox.com> 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>
Diffstat (limited to 'linux/drivers/media/video/pvrusb2')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c6
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-dvb.h1
2 files changed, 1 insertions, 6 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c b/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c
index 090ebbef9..e5991f783 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c
@@ -46,7 +46,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... */
@@ -81,7 +80,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;
}
@@ -115,8 +114,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;
}
@@ -187,7 +184,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/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.h b/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.h
index a45fa5abd..04209db87 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.h
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.h
@@ -32,7 +32,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];
};