Skip to content

Commit

Permalink
V4L/DVB (4337): Refine dead code elimination in pvrusb2
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Mike Isely authored and Mauro Carvalho Chehab committed Jul 29, 2006
1 parent 32e4c3a commit e61b6fc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
8 changes: 6 additions & 2 deletions drivers/media/video/pvrusb2/pvrusb2-hdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,6 @@ unsigned long pvr2_hdw_get_sn(struct pvr2_hdw *hdw)
return hdw->serial_number;
}


int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw)
{
return hdw->unit_number;
Expand Down Expand Up @@ -2318,7 +2317,6 @@ void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *hdw)
}
}


/* Return name for this driver instance */
const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw)
{
Expand Down Expand Up @@ -2542,6 +2540,10 @@ static void pvr2_ctl_timeout(unsigned long data)
}


/* Issue a command and get a response from the device. This extended
version includes a probe flag (which if set means that device errors
should not be logged or treated as fatal) and a timeout in jiffies.
This can be used to non-lethally probe the health of endpoint 1. */
static int pvr2_send_request_ex(struct pvr2_hdw *hdw,
unsigned int timeout,int probe_fl,
void *write_data,unsigned int write_len,
Expand Down Expand Up @@ -2970,6 +2972,7 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw)
}


/* Stop / start video stream transport */
static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl)
{
int status;
Expand Down Expand Up @@ -3068,6 +3071,7 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hdw *hdw,u32 msk,u32 val)
}


/* Find I2C address of eeprom */
static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw)
{
int result;
Expand Down
9 changes: 6 additions & 3 deletions drivers/media/video/pvrusb2/pvrusb2-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <linux/slab.h>
#include <linux/mutex.h>

static const char *pvr2_buffer_state_decode(enum pvr2_buffer_state);

#define BUFFER_SIG 0x47653271

// #define SANITY_CHECK_BUFFERS
Expand Down Expand Up @@ -515,6 +517,10 @@ void pvr2_stream_set_callback(struct pvr2_stream *sp,
}

/* Query / set the nominal buffer count */
int pvr2_stream_get_buffer_count(struct pvr2_stream *sp)
{
return sp->buffer_target_count;
}

int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt)
{
Expand Down Expand Up @@ -553,7 +559,6 @@ int pvr2_stream_get_ready_count(struct pvr2_stream *sp)
return sp->r_count;
}


void pvr2_stream_kill(struct pvr2_stream *sp)
{
struct pvr2_buffer *bp;
Expand Down Expand Up @@ -607,7 +612,6 @@ int pvr2_buffer_queue(struct pvr2_buffer *bp)
return ret;
}


int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt)
{
int ret = 0;
Expand Down Expand Up @@ -646,7 +650,6 @@ int pvr2_buffer_get_status(struct pvr2_buffer *bp)
return bp->status;
}


int pvr2_buffer_get_id(struct pvr2_buffer *bp)
{
return bp->id;
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/video/pvrusb2/pvrusb2-io.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ void pvr2_stream_set_callback(struct pvr2_stream *,
void *data);

/* Query / set the nominal buffer count */
int pvr2_stream_get_buffer_count(struct pvr2_stream *);
int pvr2_stream_set_buffer_count(struct pvr2_stream *,unsigned int);

/* Get a pointer to a buffer that is either idle, ready, or is specified
Expand All @@ -58,6 +59,7 @@ struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id);
/* Find out how many buffers are idle or ready */
int pvr2_stream_get_ready_count(struct pvr2_stream *);


/* Kill all pending buffers and throw away any ready buffers as well */
void pvr2_stream_kill(struct pvr2_stream *);

Expand Down
5 changes: 3 additions & 2 deletions drivers/media/video/pvrusb2/pvrusb2-ioread.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp)
" pvr2_ioread_setup (tear-down) id=%p",cp);
pvr2_ioread_stop(cp);
pvr2_stream_kill(cp->stream);
pvr2_stream_set_buffer_count(cp->stream,0);
if (pvr2_stream_get_buffer_count(cp->stream)) {
pvr2_stream_set_buffer_count(cp->stream,0);
}
cp->stream = NULL;
}
if (sp) {
Expand Down Expand Up @@ -251,7 +253,6 @@ int pvr2_ioread_set_enabled(struct pvr2_ioread *cp,int fl)
return ret;
}


static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
{
int stat;
Expand Down

0 comments on commit e61b6fc

Please sign in to comment.