diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-30 11:30:20 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-30 11:30:20 -0300 |
commit | 7c9fb6798a34120f38474485b91f47e8b99b3307 (patch) | |
tree | 6dd450488a01295821b013921af64bda65ca0116 | |
parent | 2113fdfbc030a48c2490ef578e8c4e17f1eaa440 (diff) | |
download | mediapointer-dvb-s2-7c9fb6798a34120f38474485b91f47e8b99b3307.tar.gz mediapointer-dvb-s2-7c9fb6798a34120f38474485b91f47e8b99b3307.tar.bz2 |
Pvrusb2/: possible cleanups
From: Adrian Bunk <bunk@stusta.de>
This patch contains the following possible cleanups:
- make needlessly global code static
- #if 0 unused global functions
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h | 17 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 84 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h | 32 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 22 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h | 3 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-io.c | 16 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-io.h | 13 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h | 1 | ||||
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 16 |
11 files changed, 94 insertions, 120 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c index 586900e36..8092b239c 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c @@ -337,8 +337,8 @@ int pvr2_debugifc_print_status(struct pvr2_hdw *hdw, } -int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf, - unsigned int count) +static int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf, + unsigned int count) { const char *wptr; unsigned int wlen; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h index cfec4d37c..63e2299cb 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h @@ -371,23 +371,6 @@ struct pvr2_hdw { unsigned int control_cnt; }; -int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw); - -unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *); - -void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, - unsigned long msk,unsigned long val); -void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, - unsigned long msk, - unsigned long val); - -void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw); -void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw); - -int pvr2_i2c_basic_op(struct pvr2_hdw *,u8 i2c_addr, - u8 *wdata,u16 wlen, - u8 *rdata,u16 rlen); - #endif /* __PVRUSB2_HDW_INTERNAL_H */ /* diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index bd3cfc477..aedcfbb0b 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -89,7 +89,7 @@ static struct pvr2_string_table pvr2_client_lists[] = { }; static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = 0}; -DECLARE_MUTEX(pvr2_unit_sem); +static DECLARE_MUTEX(pvr2_unit_sem); static int ctlchg = 0; static int initusbreset = 1; @@ -262,6 +262,25 @@ static const char *control_values_subsystem[] = { [PVR2_SUBSYS_B_ENC_RUN] = "enc_run", }; +static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl); +static int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw); +static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw); +static unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw); +static void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw); +static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw); +static void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw); +static void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, + unsigned long msk, + unsigned long val); +static void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, + unsigned long msk, + unsigned long val); +static int pvr2_send_request_ex(struct pvr2_hdw *hdw, + unsigned int timeout,int probe_fl, + void *write_data,unsigned int write_len, + void *read_data,unsigned int read_len); +static int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res); +static int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res); static int ctrl_channelfreq_get(struct pvr2_ctrl *cptr,int *vp) { @@ -834,14 +853,14 @@ unsigned long pvr2_hdw_get_sn(struct pvr2_hdw *hdw) return hdw->serial_number; } - +#if 0 struct pvr2_hdw *pvr2_hdw_find(int unit_number) { if (unit_number < 0) return 0; if (unit_number >= PVR_NUM) return 0; return unit_pointers[unit_number]; } - +#endif /* 0 */ int pvr2_hdw_get_unit_number(struct pvr2_hdw *hdw) { @@ -916,7 +935,7 @@ static int pvr2_locate_firmware(struct pvr2_hdw *hdw, * is not suitable for an usb transaction. * */ -int pvr2_upload_firmware1(struct pvr2_hdw *hdw) +static int pvr2_upload_firmware1(struct pvr2_hdw *hdw) { const struct firmware *fw_entry = 0; void *fw_ptr; @@ -1165,8 +1184,9 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) reconfigure and start over. */ -void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, - unsigned long msk,unsigned long val) +static void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, + unsigned long msk, + unsigned long val) { unsigned long nmsk; unsigned long vmsk; @@ -1316,6 +1336,7 @@ void pvr2_hdw_subsys_bit_chg(struct pvr2_hdw *hdw, } while (0); LOCK_GIVE(hdw->big_lock); } +#if 0 void pvr2_hdw_subsys_bit_set(struct pvr2_hdw *hdw,unsigned long msk) { @@ -1328,6 +1349,7 @@ void pvr2_hdw_subsys_bit_clr(struct pvr2_hdw *hdw,unsigned long msk) pvr2_hdw_subsys_bit_chg(hdw,msk,0); } +#endif /* 0 */ unsigned long pvr2_hdw_subsys_get(struct pvr2_hdw *hdw) { @@ -1341,9 +1363,9 @@ unsigned long pvr2_hdw_subsys_stream_get(struct pvr2_hdw *hdw) } -void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, - unsigned long msk, - unsigned long val) +static void pvr2_hdw_subsys_stream_bit_chg_no_lock(struct pvr2_hdw *hdw, + unsigned long msk, + unsigned long val) { unsigned long val2; msk &= PVR2_SUBSYS_ALL; @@ -1365,7 +1387,7 @@ void pvr2_hdw_subsys_stream_bit_chg(struct pvr2_hdw *hdw, } -int pvr2_hdw_set_streaming_no_lock(struct pvr2_hdw *hdw,int enableFl) +static int pvr2_hdw_set_streaming_no_lock(struct pvr2_hdw *hdw,int enableFl) { if ((!enableFl) == !(hdw->flag_streaming_enabled)) return 0; if (enableFl) { @@ -1399,8 +1421,8 @@ int pvr2_hdw_set_streaming(struct pvr2_hdw *hdw,int enable_flag) } -int pvr2_hdw_set_stream_type_no_lock(struct pvr2_hdw *hdw, - enum pvr2_config config) +static int pvr2_hdw_set_stream_type_no_lock(struct pvr2_hdw *hdw, + enum pvr2_config config) { unsigned long sm = hdw->subsys_enabled_mask; if (!hdw->flag_ok) return -EIO; @@ -1927,7 +1949,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, /* Remove _all_ associations between this driver and the underlying USB layer. */ -void pvr2_hdw_remove_usb_stuff(struct pvr2_hdw *hdw) +static void pvr2_hdw_remove_usb_stuff(struct pvr2_hdw *hdw) { if (hdw->flag_disconnected) return; pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_remove_usb_stuff: hdw=%p",hdw); @@ -2017,7 +2039,7 @@ void pvr2_hdw_disconnect(struct pvr2_hdw *hdw) // Attempt to autoselect an appropriate value for std_enum_cur given // whatever is currently in std_mask_cur -void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw) +static void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw) { unsigned int idx; for (idx = 1; idx < hdw->std_enum_cnt; idx++) { @@ -2032,7 +2054,7 @@ void pvr2_hdw_internal_find_stdenum(struct pvr2_hdw *hdw) // Calculate correct set of enumerated standards based on currently known // set of available standards bits. -void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw) +static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw) { struct v4l2_standard *newstd; unsigned int std_cnt; @@ -2181,7 +2203,7 @@ static const char *get_ctrl_typename(enum pvr2_ctl_type tp) state(s) back to their previous value before this function was called. Thus we can automatically reconfigure affected pieces of the driver as controls are changed. */ -int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw) +static int pvr2_hdw_commit_ctl_internal(struct pvr2_hdw *hdw) { unsigned long saved_subsys_mask = hdw->subsys_enabled_mask; unsigned long stale_subsys_mask = 0; @@ -2325,14 +2347,14 @@ void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *hdw) } } - +#if 0 void pvr2_hdw_poll_trigger(struct pvr2_hdw *hdw) { LOCK_TAKE(hdw->big_lock); do { pvr2_hdw_poll_trigger_unlocked(hdw); } while (0); LOCK_GIVE(hdw->big_lock); } - +#endif /* 0 */ /* Return name for this driver instance */ const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw) @@ -2342,7 +2364,7 @@ const char *pvr2_hdw_get_driver_name(struct pvr2_hdw *hdw) /* Return bit mask indicating signal status */ -unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw) +static unsigned int pvr2_hdw_get_signal_status_internal(struct pvr2_hdw *hdw) { unsigned int msk = 0; switch (hdw->input_val) { @@ -2523,7 +2545,7 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *hdw,int v) hdw->v4l_minor_number = v; } - +#if 0 void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw) { if (!hdw->usb_dev) return; @@ -2538,7 +2560,7 @@ void pvr2_reset_ctl_endpoints(struct pvr2_hdw *hdw) usb_sndbulkpipe(hdw->usb_dev, PVR2_CTL_WRITE_ENDPOINT & 0x7f)); } - +#endif /* 0 */ static void pvr2_ctl_write_complete(struct urb *urb, struct pt_regs *regs) { @@ -2573,10 +2595,10 @@ static void pvr2_ctl_timeout(unsigned long data) } -int pvr2_send_request_ex(struct pvr2_hdw *hdw, - unsigned int timeout,int probe_fl, - void *write_data,unsigned int write_len, - void *read_data,unsigned int read_len) +static int pvr2_send_request_ex(struct pvr2_hdw *hdw, + unsigned int timeout,int probe_fl, + void *write_data,unsigned int write_len, + void *read_data,unsigned int read_len) { unsigned int idx; int status = 0; @@ -2877,7 +2899,7 @@ int pvr2_write_register(struct pvr2_hdw *hdw, u16 reg, u32 data) } -int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data) +static int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data) { int ret = 0; @@ -2901,7 +2923,7 @@ int pvr2_read_register(struct pvr2_hdw *hdw, u16 reg, u32 *data) } -int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res) +static int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res) { int ret; @@ -2918,7 +2940,7 @@ int pvr2_write_u16(struct pvr2_hdw *hdw, u16 data, int res) } -int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res) +static int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res) { int ret; @@ -2934,7 +2956,7 @@ int pvr2_write_u8(struct pvr2_hdw *hdw, u8 data, int res) } -void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw) +static void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw) { if (!hdw->flag_ok) return; pvr2_trace(PVR2_TRACE_INIT,"render_useless"); @@ -3047,7 +3069,7 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw) } -int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) +static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) { int status; LOCK_TAKE(hdw->ctl_lock); do { @@ -3145,7 +3167,7 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hdw *hdw,u32 msk,u32 val) } -int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw) +static int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *hdw) { int result; LOCK_TAKE(hdw->ctl_lock); do { diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h index 310fe9d3d..4e886328d 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h @@ -92,7 +92,6 @@ 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 */ -void pvr2_hdw_poll_trigger(struct pvr2_hdw *); void pvr2_hdw_poll_trigger_unlocked(struct pvr2_hdw *); /* Register a callback used to trigger a future poll */ @@ -100,9 +99,6 @@ void pvr2_hdw_setup_poll_trigger(struct pvr2_hdw *, void (*func)(void *), void *data); -/* Get pointer to structure given unit number */ -struct pvr2_hdw *pvr2_hdw_find(int unit_number); - /* Destroy hardware interaction structure */ void pvr2_hdw_destroy(struct pvr2_hdw *); @@ -181,12 +177,6 @@ int pvr2_hdw_get_stdenum_value(struct pvr2_hdw *hdw,struct v4l2_standard *std, void pvr2_hdw_subsys_bit_chg(struct pvr2_hdw *hdw, unsigned long msk,unsigned long val); -/* Shortcut for pvr2_hdw_subsys_bit_chg(hdw,msk,msk) */ -void pvr2_hdw_subsys_bit_set(struct pvr2_hdw *hdw,unsigned long msk); - -/* Shortcut for pvr2_hdw_subsys_bit_chg(hdw,msk,0) */ -void pvr2_hdw_subsys_bit_clr(struct pvr2_hdw *hdw,unsigned long msk); - /* Retrieve mask indicating which pieces of hardware are currently enabled / configured. */ unsigned long pvr2_hdw_subsys_get(struct pvr2_hdw *); @@ -226,34 +216,18 @@ void pvr2_hdw_v4l_store_minor_number(struct pvr2_hdw *,int); /* The following entry points are all lower level things you normally don't want to worry about. */ -/* 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); - /* Issue a command and get a response from the device. LOTS of higher level stuff is built on this. */ int pvr2_send_request(struct pvr2_hdw *, void *write_ptr,unsigned int write_len, void *read_ptr,unsigned int read_len); -/* 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. */ -int pvr2_send_request_ex(struct pvr2_hdw *,unsigned int timeout,int probe_fl, - void *write_ptr,unsigned int write_len, - void *read_ptr,unsigned int read_len); - /* Slightly higher level device communication functions. */ int pvr2_write_register(struct pvr2_hdw *, u16, u32); -int pvr2_read_register(struct pvr2_hdw *, u16, u32 *); -int pvr2_write_u16(struct pvr2_hdw *, u16, int); -int pvr2_write_u8(struct pvr2_hdw *, u8, int); /* Call if for any reason we can't talk to the hardware anymore - this will cause the driver to stop flailing on the device. */ void pvr2_hdw_render_useless(struct pvr2_hdw *); -void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *); /* Set / clear 8051's reset bit */ void pvr2_hdw_cpureset_assert(struct pvr2_hdw *,int); @@ -272,12 +246,6 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *); /* Order decoder to reset */ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *); -/* Stop / start video stream transport */ -int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl); - -/* Find I2C address of eeprom */ -int pvr2_hdw_get_eeprom_addr(struct pvr2_hdw *); - /* Direct manipulation of GPIO bits */ int pvr2_hdw_gpio_get_dir(struct pvr2_hdw *hdw,u32 *); int pvr2_hdw_gpio_get_out(struct pvr2_hdw *hdw,u32 *); diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c index 4f1f4b000..19ffb38f7 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c @@ -38,6 +38,10 @@ static unsigned int i2c_scan = 0; module_param(i2c_scan, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(i2c_scan,"scan i2c bus at insmod time"); +static unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp, + unsigned int detail, + char *buf,unsigned int maxlen); + static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */ u8 i2c_addr, /* I2C address we're talking to */ u8 *data, /* Data to write */ @@ -180,12 +184,12 @@ static int pvr2_i2c_read(struct pvr2_hdw *hdw, /* Context */ /* This is the common low level entry point for doing I2C operations to the hardware. */ -int pvr2_i2c_basic_op(struct pvr2_hdw *hdw, - u8 i2c_addr, - u8 *wdata, - u16 wlen, - u8 *rdata, - u16 rlen) +static int pvr2_i2c_basic_op(struct pvr2_hdw *hdw, + u8 i2c_addr, + u8 *wdata, + u16 wlen, + u8 *rdata, + u16 rlen) { if (!rdata) rlen = 0; if (!wdata) wlen = 0; @@ -728,9 +732,9 @@ int pvr2_i2c_core_check_stale(struct pvr2_hdw *hdw) return (hdw->i2c_pend_types & PVR2_I2C_PEND_ALL) != 0; } -unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp, - unsigned int detail, - char *buf,unsigned int maxlen) +static unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *cp, + unsigned int detail, + char *buf,unsigned int maxlen) { unsigned int ccnt,bcnt; int spcfl = 0; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h index e8af5b0ed..6d7e25247 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h @@ -75,9 +75,6 @@ unsigned int pvr2_i2c_report(struct pvr2_hdw *,char *buf,unsigned int maxlen); PVR2_I2C_DETAIL_DEBUG |\ PVR2_I2C_DETAIL_HANDLER |\ PVR2_I2C_DETAIL_CTLMASK) -unsigned int pvr2_i2c_client_describe(struct pvr2_i2c_client *, - unsigned int detail_mask, - char *buf,unsigned int maxlen); void pvr2_i2c_probe(struct pvr2_hdw *,struct pvr2_i2c_client *); const struct pvr2_i2c_op *pvr2_i2c_get_op(unsigned int idx); diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-io.c b/linux/drivers/media/video/pvrusb2/pvrusb2-io.c index cb0ca6376..b2ace5403 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-io.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-io.c @@ -113,7 +113,7 @@ struct pvr2_buffer { struct urb *purb; }; -const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st) +static const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st) { switch (st) { case pvr2_buffer_state_none: return "none"; @@ -124,7 +124,8 @@ const char *pvr2_buffer_state_decode(enum pvr2_buffer_state st) return "unknown"; } -void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) +#ifdef SANITY_CHECK_BUFFERS +static void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) { pvr2_trace(PVR2_TRACE_INFO, "buffer%s%s %p state=%s id=%d status=%d" @@ -139,6 +140,7 @@ void pvr2_buffer_describe(struct pvr2_buffer *bp,const char *msg) (bp ? bp->purb : 0), (bp ? bp->signature : 0)); } +#endif /* SANITY_CHECK_BUFFERS */ static void pvr2_buffer_remove(struct pvr2_buffer *bp) { @@ -533,10 +535,12 @@ 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) { @@ -575,6 +579,8 @@ 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; @@ -587,6 +593,8 @@ void pvr2_stream_flush(struct pvr2_stream *sp) } while(0); mutex_unlock(&sp->mutex); } +#endif /* 0 */ + void pvr2_stream_kill(struct pvr2_stream *sp) { struct pvr2_buffer *bp; @@ -640,6 +648,7 @@ int pvr2_buffer_queue(struct pvr2_buffer *bp) return ret; } +#if 0 int pvr2_buffer_idle(struct pvr2_buffer *bp) { struct pvr2_stream *sp; @@ -654,6 +663,7 @@ int pvr2_buffer_idle(struct pvr2_buffer *bp) } while(0); mutex_unlock(&sp->mutex); return 0; } +#endif /* 0 */ int pvr2_buffer_set_buffer(struct pvr2_buffer *bp,void *ptr,unsigned int cnt) { @@ -693,10 +703,12 @@ int pvr2_buffer_get_status(struct pvr2_buffer *bp) return bp->status; } +#if 0 enum pvr2_buffer_state pvr2_buffer_get_state(struct pvr2_buffer *bp) { return bp->state; } +#endif /* 0 */ int pvr2_buffer_get_id(struct pvr2_buffer *bp) { diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-io.h b/linux/drivers/media/video/pvrusb2/pvrusb2-io.h index 65e11385b..96285ad23 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-io.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-io.h @@ -36,8 +36,6 @@ enum pvr2_buffer_state { struct pvr2_stream; struct pvr2_buffer; -const char *pvr2_buffer_state_decode(enum pvr2_buffer_state); - /* Initialize / tear down stream structure */ struct pvr2_stream *pvr2_stream_create(void); void pvr2_stream_destroy(struct pvr2_stream *); @@ -49,7 +47,6 @@ 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 @@ -59,12 +56,8 @@ 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 */ -int pvr2_stream_get_idle_count(struct pvr2_stream *); int pvr2_stream_get_ready_count(struct pvr2_stream *); -/* Kill all pending operations */ -void pvr2_stream_flush(struct pvr2_stream *); - /* Kill all pending buffers and throw away any ready buffers as well */ void pvr2_stream_kill(struct pvr2_stream *); @@ -77,18 +70,12 @@ unsigned int pvr2_buffer_get_count(struct pvr2_buffer *); /* Retrieve completion code for given ready buffer */ int pvr2_buffer_get_status(struct pvr2_buffer *); -/* Retrieve state of given buffer */ -enum pvr2_buffer_state pvr2_buffer_get_state(struct pvr2_buffer *); - /* 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 *); -/* Move buffer back to idle pool (kill it if needed) */ -int pvr2_buffer_idle(struct pvr2_buffer *); - #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 555dbbca8..f23ca9b5d 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c @@ -260,12 +260,14 @@ int pvr2_ioread_set_enabled(struct pvr2_ioread *cp,int fl) return ret; } +#if 0 int pvr2_ioread_get_enabled(struct pvr2_ioread *cp) { return cp->enabled != 0; } +#endif /* 0 */ -int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) +static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) { int stat; @@ -316,7 +318,7 @@ int pvr2_ioread_get_buffer(struct pvr2_ioread *cp) return !0; } -void pvr2_ioread_filter(struct pvr2_ioread *cp) +static void pvr2_ioread_filter(struct pvr2_ioread *cp) { unsigned int idx; if (!cp->enabled) return; diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h b/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h index 6b002597f..1d362f833 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h @@ -33,7 +33,6 @@ 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); -int pvr2_ioread_get_enabled(struct pvr2_ioread *); int pvr2_ioread_read(struct pvr2_ioread *,void __user *buf,unsigned int cnt); int pvr2_ioread_avail(struct pvr2_ioread *); diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index a74eecf87..110429a62 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -82,7 +82,7 @@ static int video_nr[PVR_NUM] = {[0 ... PVR_NUM-1] = -1}; module_param_array(video_nr, int, NULL, 0444); MODULE_PARM_DESC(video_nr, "Offset for device's minor"); -struct v4l2_capability pvr_capability ={ +static struct v4l2_capability pvr_capability ={ .driver = "pvrusb2", .card = "Hauppauge WinTV pvr-usb2", .bus_info = "usb", @@ -127,7 +127,7 @@ static struct v4l2_tuner pvr_v4l2_tuners[]= { #endif }; -struct v4l2_fmtdesc pvr_fmtdesc [] = { +static struct v4l2_fmtdesc pvr_fmtdesc [] = { { .index = 0, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, @@ -143,7 +143,7 @@ struct v4l2_fmtdesc pvr_fmtdesc [] = { #define PVR_FORMAT_PIX 0 #define PVR_FORMAT_VBI 1 -struct v4l2_format pvr_format [] = { +static struct v4l2_format pvr_format [] = { [PVR_FORMAT_PIX] = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, .fmt = { @@ -740,7 +740,7 @@ static void pvr2_v4l2_destroy_no_lock(struct pvr2_v4l2 *vp) } -void pvr2_v4l2_internal_check(struct pvr2_channel *chp) +static void pvr2_v4l2_internal_check(struct pvr2_channel *chp) { struct pvr2_v4l2 *vp; vp = container_of(chp,struct pvr2_v4l2,channel); @@ -750,8 +750,8 @@ void pvr2_v4l2_internal_check(struct pvr2_channel *chp) } -int pvr2_v4l2_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) +static int pvr2_v4l2_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) { /* Temporary hack : use ivtv api until a v4l2 one is available. */ @@ -762,7 +762,7 @@ int pvr2_v4l2_ioctl(struct inode *inode, struct file *file, } -int pvr2_v4l2_release(struct inode *inode, struct file *file) +static int pvr2_v4l2_release(struct inode *inode, struct file *file) { struct pvr2_v4l2_fh *fhp = file->private_data; struct pvr2_v4l2 *vp = fhp->vhead; @@ -809,7 +809,7 @@ int pvr2_v4l2_release(struct inode *inode, struct file *file) } -int pvr2_v4l2_open(struct inode *inode, struct file *file) +static int pvr2_v4l2_open(struct inode *inode, struct file *file) { struct pvr2_v4l2_dev *dip = 0; /* Our own context pointer */ struct pvr2_v4l2_fh *fhp; |