diff options
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-io.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-io.c | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-io.c b/drivers/media/video/pvrusb2/pvrusb2-io.c index a984c91f571..c032777a977 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-io.c +++ b/drivers/media/video/pvrusb2/pvrusb2-io.c | |||
@@ -93,7 +93,7 @@ struct pvr2_buffer { | |||
93 | struct urb *purb; | 93 | struct urb *purb; |
94 | }; | 94 | }; |
95 | 95 | ||
96 | const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st) | 96 | static const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st) |
97 | { | 97 | { |
98 | switch (st) { | 98 | switch (st) { |
99 | case pvr2_buffer_state_none: return "none"; | 99 | case pvr2_buffer_state_none: return "none"; |
@@ -104,7 +104,8 @@ const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st) | |||
104 | return "unknown"; | 104 | return "unknown"; |
105 | } | 105 | } |
106 | 106 | ||
107 | void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) | 107 | #ifdef SANITY_CHECK_BUFFERS |
108 | static void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) | ||
108 | { | 109 | { |
109 | pvr2_trace(PVR2_TRACE_INFO, | 110 | pvr2_trace(PVR2_TRACE_INFO, |
110 | "buffer%s%s %p state=%s id=%d status=%d" | 111 | "buffer%s%s %p state=%s id=%d status=%d" |
@@ -119,6 +120,7 @@ void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) | |||
119 | (bp ? bp->purb : 0), | 120 | (bp ? bp->purb : 0), |
120 | (bp ? bp->signature : 0)); | 121 | (bp ? bp->signature : 0)); |
121 | } | 122 | } |
123 | #endif /* SANITY_CHECK_BUFFERS */ | ||
122 | 124 | ||
123 | static void pvr2_buffer_remove(struct pvr2_buffer *bp) | 125 | static void pvr2_buffer_remove(struct pvr2_buffer *bp) |
124 | { | 126 | { |
@@ -513,10 +515,6 @@ void pvr2_stream_set_callback(struct pvr2_stream *sp, | |||
513 | } | 515 | } |
514 | 516 | ||
515 | /* Query / set the nominal buffer count */ | 517 | /* Query / set the nominal buffer count */ |
516 | int pvr2_stream_get_buffer_count(struct pvr2_stream *sp) | ||
517 | { | ||
518 | return sp->buffer_target_count; | ||
519 | } | ||
520 | 518 | ||
521 | int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt) | 519 | int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt) |
522 | { | 520 | { |
@@ -555,17 +553,6 @@ int pvr2_stream_get_ready_count(struct pvr2_stream *sp) | |||
555 | return sp->r_count; | 553 | return sp->r_count; |
556 | } | 554 | } |
557 | 555 | ||
558 | int pvr2_stream_get_idle_count(struct pvr2_stream *sp) | ||
559 | { | ||
560 | return sp->i_count; | ||
561 | } | ||
562 | |||
563 | void pvr2_stream_flush(struct pvr2_stream *sp) | ||
564 | { | ||
565 | mutex_lock(&sp->mutex); do { | ||
566 | pvr2_stream_internal_flush(sp); | ||
567 | } while(0); mutex_unlock(&sp->mutex); | ||
568 | } | ||
569 | 556 | ||
570 | void pvr2_stream_kill(struct pvr2_stream *sp) | 557 | void pvr2_stream_kill(struct pvr2_stream *sp) |
571 | { | 558 | { |
@@ -620,20 +607,6 @@ int pvr2_buffer_queue(struct pvr2_buffer *bp) | |||
620 | return ret; | 607 | return ret; |
621 | } | 608 | } |
622 | 609 | ||
623 | int pvr2_buffer_idle(struct pvr2_buffer *bp) | ||
624 | { | ||
625 | struct pvr2_stream *sp; | ||
626 | if (!bp) return -EINVAL; | ||
627 | sp = bp->stream; | ||
628 | mutex_lock(&sp->mutex); do { | ||
629 | pvr2_buffer_wipe(bp); | ||
630 | pvr2_buffer_set_idle(bp); | ||
631 | if (sp->buffer_total_count != sp->buffer_target_count) { | ||
632 | pvr2_stream_achieve_buffer_count(sp); | ||
633 | } | ||
634 | } while(0); mutex_unlock(&sp->mutex); | ||
635 | return 0; | ||
636 | } | ||
637 | 610 | ||
638 | int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt) | 611 | int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt) |
639 | { | 612 | { |
@@ -673,10 +646,6 @@ int pvr2_buffer_get_status(struct pvr2_buffer *bp) | |||
673 | return bp->status; | 646 | return bp->status; |
674 | } | 647 | } |
675 | 648 | ||
676 | enum pvr2_buffer_state pvr2_buffer_get_state(struct pvr2_buffer *bp) | ||
677 | { | ||
678 | return bp->state; | ||
679 | } | ||
680 | 649 | ||
681 | int pvr2_buffer_get_id(struct pvr2_buffer *bp) | 650 | int pvr2_buffer_get_id(struct pvr2_buffer *bp) |
682 | { | 651 | { |