diff options
author | Mike Isely <isely@pobox.com> | 2006-07-18 20:42:18 -0500 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2006-07-18 20:42:18 -0500 |
commit | b75a23337c003e45c5017f29cbeb4189a6b1e8f1 (patch) | |
tree | 28be710aa1309ae7bdcd6f1840a7a0e654b11778 /linux/drivers/media/video | |
parent | 82a8cd5b91676683cfa89ef44c35f60db77c6f2a (diff) | |
download | mediapointer-dvb-s2-b75a23337c003e45c5017f29cbeb4189a6b1e8f1.tar.gz mediapointer-dvb-s2-b75a23337c003e45c5017f29cbeb4189a6b1e8f1.tar.bz2 |
Refine dead code elimination in pvrusb2
From: Mike Isely <isely@pobox.com>
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 21 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h | 8 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-io.c | 12 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-io.h | 19 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h | 3 |
6 files changed, 57 insertions, 12 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 5ad657e89..fa4a56f7a 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -860,8 +860,8 @@ struct pvr2_hdw *pvr2_hdw_find(int unit_number) if (unit_number >= PVR_NUM) return NULL; return unit_pointers[unit_number]; } -#endif /* 0 */ +#endif /* 0 */ int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw) { return hdw->unit_number; @@ -1337,13 +1337,16 @@ void pvr2_hdw_subsys_bit_chg(struct pvr2_hdw *hdw, } #if 0 - +/* Shortcut for pvr2_hdw_subsys_bit_chg(hdw,msk,msk) */ void pvr2_hdw_subsys_bit_set(struct pvr2_hdw *hdw,unsigned long msk) { pvr2_hdw_subsys_bit_chg(hdw,msk,msk); } +#endif /* 0 */ +#if 0 +/* Shortcut for pvr2_hdw_subsys_bit_chg(hdw,msk,0) */ void pvr2_hdw_subsys_bit_clr(struct pvr2_hdw *hdw,unsigned long msk) { pvr2_hdw_subsys_bit_chg(hdw,msk,0); @@ -2354,8 +2357,8 @@ void pvr2_hdw_poll_trigger(struct pvr2_hdw *hdw) pvr2_hdw_poll_trigger_unlocked(hdw); } while (0); LOCK_GIVE(hdw->big_lock); } -#endif /* 0 */ +#endif /* 0 */ /* Return name for this driver instance */ const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw) { @@ -2545,7 +2548,10 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw,int v) hdw->v4l_minor_number = v; } + #if 0 +/* Attempt to recover from a USB foul-up (in practice I find that if you + have to do this, then it's already too late). */ void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw) { if (!hdw->usb_dev) return; @@ -2560,8 +2566,9 @@ void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw) usb_sndbulkpipe(hdw->usb_dev, PVR2_CTL_WRITE_ENDPOINT & 0x7f)); } -#endif /* 0 */ + +#endif /* 0 */ static void pvr2_ctl_write_complete(struct urb *urb, struct pt_regs *regs) { struct pvr2_hdw *hdw = urb->context; @@ -2595,6 +2602,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, @@ -3069,6 +3080,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; @@ -3167,6 +3179,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; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h index 4e886328d..141961488 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h @@ -92,6 +92,9 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, void pvr2_hdw_poll(struct pvr2_hdw *); /* Trigger a poll to take place later at a convenient time */ +#if 0 +void pvr2_hdw_poll_trigger(struct pvr2_hdw *); +#endif /* 0 */ void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *); /* Register a callback used to trigger a future poll */ @@ -99,6 +102,11 @@ void pvr2_hdw_setup_poll_trigger(struct pvr2_hdw *, void (*func)(void *), void *data); +#if 0 +/* Get pointer to structure given unit number */ +struct pvr2_hdw *pvr2_hdw_find(int unit_number); + +#endif /* 0 */ /* Destroy hardware interaction structure */ void pvr2_hdw_destroy(struct pvr2_hdw *); diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-io.c b/linux/drivers/media/video/pvrusb2/pvrusb2-io.c index 1c1cf9024..7b3b53010 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-io.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-io.c @@ -31,6 +31,8 @@ #include <asm/semaphore.h> #endif +static const char *pvr2_buffer_state_decode(enum pvr2_buffer_state); + #define BUFFER_SIG 0x47653271 // #define SANITY_CHECK_BUFFERS @@ -535,12 +537,10 @@ void pvr2_stream_set_callback(struct pvr2_stream *sp, } /* Query / set the nominal buffer count */ -#if 0 int pvr2_stream_get_buffer_count(struct pvr2_stream *sp) { return sp->buffer_target_count; } -#endif /* 0 */ int pvr2_stream_set_buffer_count(struct pvr2_stream *sp,unsigned int cnt) { @@ -578,13 +578,14 @@ int pvr2_stream_get_ready_count(struct pvr2_stream *sp) { return sp->r_count; } - #if 0 int pvr2_stream_get_idle_count(struct pvr2_stream *sp) { return sp->i_count; } +#endif /* 0 */ +#if 0 void pvr2_stream_flush(struct pvr2_stream *sp) { @@ -592,7 +593,6 @@ void pvr2_stream_flush(struct pvr2_stream *sp) pvr2_stream_internal_flush(sp); } while(0); mutex_unlock(&sp->mutex); } - #endif /* 0 */ void pvr2_stream_kill(struct pvr2_stream *sp) @@ -663,8 +663,8 @@ int pvr2_buffer_idle(struct pvr2_buffer *bp) } while(0); mutex_unlock(&sp->mutex); return 0; } -#endif /* 0 */ +#endif /* 0 */ int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt) { int ret = 0; @@ -708,8 +708,8 @@ enum pvr2_buffer_state pvr2_buffer_get_state(struct pvr2_buffer *bp) { return bp->state; } -#endif /* 0 */ +#endif /* 0 */ int pvr2_buffer_get_id(struct pvr2_buffer *bp) { return bp->id; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-io.h b/linux/drivers/media/video/pvrusb2/pvrusb2-io.h index 96285ad23..b43e5f4cf 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-io.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-io.h @@ -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 @@ -56,8 +57,16 @@ struct pvr2_buffer *pvr2_stream_get_ready_buffer(struct pvr2_stream *); struct pvr2_buffer *pvr2_stream_get_buffer(struct pvr2_stream *sp,int id); /* Find out how many buffers are idle or ready */ +#if 0 +int pvr2_stream_get_idle_count(struct pvr2_stream *); +#endif /* 0 */ int pvr2_stream_get_ready_count(struct pvr2_stream *); +#if 0 +/* Kill all pending operations */ +void pvr2_stream_flush(struct pvr2_stream *); +#endif /* 0 */ + /* Kill all pending buffers and throw away any ready buffers as well */ void pvr2_stream_kill(struct pvr2_stream *); @@ -70,12 +79,22 @@ unsigned int pvr2_buffer_get_count(struct pvr2_buffer *); /* Retrieve completion code for given ready buffer */ int pvr2_buffer_get_status(struct pvr2_buffer *); +#if 0 +/* Retrieve state of given buffer */ +enum pvr2_buffer_state pvr2_buffer_get_state(struct pvr2_buffer *); + +#endif /* 0 */ /* Retrieve ID of given buffer */ int pvr2_buffer_get_id(struct pvr2_buffer *); /* Start reading into given buffer (kill it if needed) */ int pvr2_buffer_queue(struct pvr2_buffer *); +#if 0 +/* Move buffer back to idle pool (kill it if needed) */ +int pvr2_buffer_idle(struct pvr2_buffer *); + +#endif /* 0 */ #endif /* __PVRUSB2_IO_H */ /* diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c b/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c index 06d3d9a38..28385b0c9 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c @@ -222,7 +222,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) { @@ -265,8 +267,8 @@ int pvr2_ioread_get_enabled(struct pvr2_ioread *cp) { return cp->enabled != 0; } -#endif /* 0 */ +#endif /* 0 */ static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) { int stat; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h b/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h index 1d362f833..fe397e987 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h @@ -33,6 +33,9 @@ void pvr2_ioread_set_sync_key(struct pvr2_ioread *, const char *sync_key_ptr, unsigned int sync_key_len); int pvr2_ioread_set_enabled(struct pvr2_ioread *,int fl); +#if 0 +int pvr2_ioread_get_enabled(struct pvr2_ioread *); +#endif /* 0 */ int pvr2_ioread_read(struct pvr2_ioread *,void __user *buf,unsigned int cnt); int pvr2_ioread_avail(struct pvr2_ioread *); |