diff options
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 9638591cc06f..9b48abcf6089 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -87,7 +87,7 @@ static struct pvr2_string_table pvr2_client_lists[] = { | |||
87 | #endif | 87 | #endif |
88 | }; | 88 | }; |
89 | 89 | ||
90 | static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = 0}; | 90 | static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = NULL}; |
91 | static DECLARE_MUTEX(pvr2_unit_sem); | 91 | static DECLARE_MUTEX(pvr2_unit_sem); |
92 | 92 | ||
93 | static int ctlchg = 0; | 93 | static int ctlchg = 0; |
@@ -422,7 +422,7 @@ static unsigned int ctrl_cx2341x_getv4lflags(struct pvr2_ctrl *cptr) | |||
422 | info = (struct pvr2_ctl_info *)(cptr->info); | 422 | info = (struct pvr2_ctl_info *)(cptr->info); |
423 | if (qctrl.flags & V4L2_CTRL_FLAG_READ_ONLY) { | 423 | if (qctrl.flags & V4L2_CTRL_FLAG_READ_ONLY) { |
424 | if (info->set_value) { | 424 | if (info->set_value) { |
425 | info->set_value = 0; | 425 | info->set_value = NULL; |
426 | } | 426 | } |
427 | } else { | 427 | } else { |
428 | if (!(info->set_value)) { | 428 | if (!(info->set_value)) { |
@@ -928,7 +928,7 @@ static int pvr2_locate_firmware(struct pvr2_hdw *hdw, | |||
928 | */ | 928 | */ |
929 | static int pvr2_upload_firmware1(struct pvr2_hdw *hdw) | 929 | static int pvr2_upload_firmware1(struct pvr2_hdw *hdw) |
930 | { | 930 | { |
931 | const struct firmware *fw_entry = 0; | 931 | const struct firmware *fw_entry = NULL; |
932 | void *fw_ptr; | 932 | void *fw_ptr; |
933 | unsigned int pipe; | 933 | unsigned int pipe; |
934 | int ret; | 934 | int ret; |
@@ -1024,7 +1024,7 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw) | |||
1024 | 1024 | ||
1025 | int pvr2_upload_firmware2(struct pvr2_hdw *hdw) | 1025 | int pvr2_upload_firmware2(struct pvr2_hdw *hdw) |
1026 | { | 1026 | { |
1027 | const struct firmware *fw_entry = 0; | 1027 | const struct firmware *fw_entry = NULL; |
1028 | void *fw_ptr; | 1028 | void *fw_ptr; |
1029 | unsigned int pipe, fw_len, fw_done; | 1029 | unsigned int pipe, fw_len, fw_done; |
1030 | int actual_length; | 1030 | int actual_length; |
@@ -1739,7 +1739,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, | |||
1739 | sizeof(pvr2_device_names)/sizeof(pvr2_device_names[0])) { | 1739 | sizeof(pvr2_device_names)/sizeof(pvr2_device_names[0])) { |
1740 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, | 1740 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
1741 | "Bogus device type of %u reported",hdw_type); | 1741 | "Bogus device type of %u reported",hdw_type); |
1742 | return 0; | 1742 | return NULL; |
1743 | } | 1743 | } |
1744 | 1744 | ||
1745 | hdw = kmalloc(sizeof(*hdw),GFP_KERNEL); | 1745 | hdw = kmalloc(sizeof(*hdw),GFP_KERNEL); |
@@ -1920,7 +1920,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, | |||
1920 | if (hdw->mpeg_ctrl_info) kfree(hdw->mpeg_ctrl_info); | 1920 | if (hdw->mpeg_ctrl_info) kfree(hdw->mpeg_ctrl_info); |
1921 | kfree(hdw); | 1921 | kfree(hdw); |
1922 | } | 1922 | } |
1923 | return 0; | 1923 | return NULL; |
1924 | } | 1924 | } |
1925 | 1925 | ||
1926 | 1926 | ||
@@ -1933,25 +1933,25 @@ static void pvr2_hdw_remove_usb_stuff(struct pvr2_hdw *hdw) | |||
1933 | if (hdw->ctl_read_urb) { | 1933 | if (hdw->ctl_read_urb) { |
1934 | usb_kill_urb(hdw->ctl_read_urb); | 1934 | usb_kill_urb(hdw->ctl_read_urb); |
1935 | usb_free_urb(hdw->ctl_read_urb); | 1935 | usb_free_urb(hdw->ctl_read_urb); |
1936 | hdw->ctl_read_urb = 0; | 1936 | hdw->ctl_read_urb = NULL; |
1937 | } | 1937 | } |
1938 | if (hdw->ctl_write_urb) { | 1938 | if (hdw->ctl_write_urb) { |
1939 | usb_kill_urb(hdw->ctl_write_urb); | 1939 | usb_kill_urb(hdw->ctl_write_urb); |
1940 | usb_free_urb(hdw->ctl_write_urb); | 1940 | usb_free_urb(hdw->ctl_write_urb); |
1941 | hdw->ctl_write_urb = 0; | 1941 | hdw->ctl_write_urb = NULL; |
1942 | } | 1942 | } |
1943 | if (hdw->ctl_read_buffer) { | 1943 | if (hdw->ctl_read_buffer) { |
1944 | kfree(hdw->ctl_read_buffer); | 1944 | kfree(hdw->ctl_read_buffer); |
1945 | hdw->ctl_read_buffer = 0; | 1945 | hdw->ctl_read_buffer = NULL; |
1946 | } | 1946 | } |
1947 | if (hdw->ctl_write_buffer) { | 1947 | if (hdw->ctl_write_buffer) { |
1948 | kfree(hdw->ctl_write_buffer); | 1948 | kfree(hdw->ctl_write_buffer); |
1949 | hdw->ctl_write_buffer = 0; | 1949 | hdw->ctl_write_buffer = NULL; |
1950 | } | 1950 | } |
1951 | pvr2_hdw_render_useless_unlocked(hdw); | 1951 | pvr2_hdw_render_useless_unlocked(hdw); |
1952 | hdw->flag_disconnected = !0; | 1952 | hdw->flag_disconnected = !0; |
1953 | hdw->usb_dev = 0; | 1953 | hdw->usb_dev = NULL; |
1954 | hdw->usb_intf = 0; | 1954 | hdw->usb_intf = NULL; |
1955 | } | 1955 | } |
1956 | 1956 | ||
1957 | 1957 | ||
@@ -1961,11 +1961,11 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw) | |||
1961 | pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_destroy: hdw=%p",hdw); | 1961 | pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_destroy: hdw=%p",hdw); |
1962 | if (hdw->fw_buffer) { | 1962 | if (hdw->fw_buffer) { |
1963 | kfree(hdw->fw_buffer); | 1963 | kfree(hdw->fw_buffer); |
1964 | hdw->fw_buffer = 0; | 1964 | hdw->fw_buffer = NULL; |
1965 | } | 1965 | } |
1966 | if (hdw->vid_stream) { | 1966 | if (hdw->vid_stream) { |
1967 | pvr2_stream_destroy(hdw->vid_stream); | 1967 | pvr2_stream_destroy(hdw->vid_stream); |
1968 | hdw->vid_stream = 0; | 1968 | hdw->vid_stream = NULL; |
1969 | } | 1969 | } |
1970 | if (hdw->audio_stat) { | 1970 | if (hdw->audio_stat) { |
1971 | hdw->audio_stat->detach(hdw->audio_stat->ctxt); | 1971 | hdw->audio_stat->detach(hdw->audio_stat->ctxt); |
@@ -1979,7 +1979,7 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw) | |||
1979 | if ((hdw->unit_number >= 0) && | 1979 | if ((hdw->unit_number >= 0) && |
1980 | (hdw->unit_number < PVR_NUM) && | 1980 | (hdw->unit_number < PVR_NUM) && |
1981 | (unit_pointers[hdw->unit_number] == hdw)) { | 1981 | (unit_pointers[hdw->unit_number] == hdw)) { |
1982 | unit_pointers[hdw->unit_number] = 0; | 1982 | unit_pointers[hdw->unit_number] = NULL; |
1983 | } | 1983 | } |
1984 | } while (0); up(&pvr2_unit_sem); | 1984 | } while (0); up(&pvr2_unit_sem); |
1985 | if (hdw->controls) kfree(hdw->controls); | 1985 | if (hdw->controls) kfree(hdw->controls); |
@@ -2041,12 +2041,12 @@ static void pvr2_hdw_internal_set_std_avail(struct pvr2_hdw *hdw) | |||
2041 | 2041 | ||
2042 | if (hdw->std_defs) { | 2042 | if (hdw->std_defs) { |
2043 | kfree(hdw->std_defs); | 2043 | kfree(hdw->std_defs); |
2044 | hdw->std_defs = 0; | 2044 | hdw->std_defs = NULL; |
2045 | } | 2045 | } |
2046 | hdw->std_enum_cnt = 0; | 2046 | hdw->std_enum_cnt = 0; |
2047 | if (hdw->std_enum_names) { | 2047 | if (hdw->std_enum_names) { |
2048 | kfree(hdw->std_enum_names); | 2048 | kfree(hdw->std_enum_names); |
2049 | hdw->std_enum_names = 0; | 2049 | hdw->std_enum_names = NULL; |
2050 | } | 2050 | } |
2051 | 2051 | ||
2052 | if (!std_cnt) { | 2052 | if (!std_cnt) { |
@@ -2097,7 +2097,7 @@ unsigned int pvr2_hdw_get_ctrl_count(struct pvr2_hdw *hdw) | |||
2097 | struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_index(struct pvr2_hdw *hdw, | 2097 | struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_index(struct pvr2_hdw *hdw, |
2098 | unsigned int idx) | 2098 | unsigned int idx) |
2099 | { | 2099 | { |
2100 | if (idx >= hdw->control_cnt) return 0; | 2100 | if (idx >= hdw->control_cnt) return NULL; |
2101 | return hdw->controls + idx; | 2101 | return hdw->controls + idx; |
2102 | } | 2102 | } |
2103 | 2103 | ||
@@ -2116,7 +2116,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_by_id(struct pvr2_hdw *hdw, | |||
2116 | i = cptr->info->internal_id; | 2116 | i = cptr->info->internal_id; |
2117 | if (i && (i == ctl_id)) return cptr; | 2117 | if (i && (i == ctl_id)) return cptr; |
2118 | } | 2118 | } |
2119 | return 0; | 2119 | return NULL; |
2120 | } | 2120 | } |
2121 | 2121 | ||
2122 | 2122 | ||
@@ -2133,7 +2133,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_v4l(struct pvr2_hdw *hdw,unsigned int ctl_id | |||
2133 | i = cptr->info->v4l_id; | 2133 | i = cptr->info->v4l_id; |
2134 | if (i && (i == ctl_id)) return cptr; | 2134 | if (i && (i == ctl_id)) return cptr; |
2135 | } | 2135 | } |
2136 | return 0; | 2136 | return NULL; |
2137 | } | 2137 | } |
2138 | 2138 | ||
2139 | 2139 | ||
@@ -2147,7 +2147,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_nextv4l(struct pvr2_hdw *hdw, | |||
2147 | int i; | 2147 | int i; |
2148 | 2148 | ||
2149 | /* This could be made a lot more efficient, but for now... */ | 2149 | /* This could be made a lot more efficient, but for now... */ |
2150 | cp2 = 0; | 2150 | cp2 = NULL; |
2151 | for (idx = 0; idx < hdw->control_cnt; idx++) { | 2151 | for (idx = 0; idx < hdw->control_cnt; idx++) { |
2152 | cptr = hdw->controls + idx; | 2152 | cptr = hdw->controls + idx; |
2153 | i = cptr->info->v4l_id; | 2153 | i = cptr->info->v4l_id; |
@@ -2157,7 +2157,7 @@ struct pvr2_ctrl *pvr2_hdw_get_ctrl_nextv4l(struct pvr2_hdw *hdw, | |||
2157 | cp2 = cptr; | 2157 | cp2 = cptr; |
2158 | } | 2158 | } |
2159 | return cp2; | 2159 | return cp2; |
2160 | return 0; | 2160 | return NULL; |
2161 | } | 2161 | } |
2162 | 2162 | ||
2163 | 2163 | ||
@@ -2414,7 +2414,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, int enable_flag) | |||
2414 | pvr2_trace(PVR2_TRACE_FIRMWARE, | 2414 | pvr2_trace(PVR2_TRACE_FIRMWARE, |
2415 | "Cleaning up after CPU firmware fetch"); | 2415 | "Cleaning up after CPU firmware fetch"); |
2416 | kfree(hdw->fw_buffer); | 2416 | kfree(hdw->fw_buffer); |
2417 | hdw->fw_buffer = 0; | 2417 | hdw->fw_buffer = NULL; |
2418 | hdw->fw_size = 0; | 2418 | hdw->fw_size = 0; |
2419 | /* Now release the CPU. It will disconnect and | 2419 | /* Now release the CPU. It will disconnect and |
2420 | reconnect later. */ | 2420 | reconnect later. */ |
@@ -2863,7 +2863,7 @@ static void pvr2_hdw_render_useless_unlocked(struct pvr2_hdw *hdw) | |||
2863 | pvr2_trace(PVR2_TRACE_INIT,"render_useless"); | 2863 | pvr2_trace(PVR2_TRACE_INIT,"render_useless"); |
2864 | hdw->flag_ok = 0; | 2864 | hdw->flag_ok = 0; |
2865 | if (hdw->vid_stream) { | 2865 | if (hdw->vid_stream) { |
2866 | pvr2_stream_setup(hdw->vid_stream,0,0,0); | 2866 | pvr2_stream_setup(hdw->vid_stream,NULL,0,0); |
2867 | } | 2867 | } |
2868 | hdw->flag_streaming_enabled = 0; | 2868 | hdw->flag_streaming_enabled = 0; |
2869 | hdw->subsys_enabled_mask = 0; | 2869 | hdw->subsys_enabled_mask = 0; |
@@ -2882,7 +2882,7 @@ void pvr2_hdw_device_reset(struct pvr2_hdw *hdw) | |||
2882 | { | 2882 | { |
2883 | int ret; | 2883 | int ret; |
2884 | pvr2_trace(PVR2_TRACE_INIT,"Performing a device reset..."); | 2884 | pvr2_trace(PVR2_TRACE_INIT,"Performing a device reset..."); |
2885 | ret = usb_lock_device_for_reset(hdw->usb_dev,0); | 2885 | ret = usb_lock_device_for_reset(hdw->usb_dev,NULL); |
2886 | if (ret == 1) { | 2886 | if (ret == 1) { |
2887 | ret = usb_reset_device(hdw->usb_dev); | 2887 | ret = usb_reset_device(hdw->usb_dev); |
2888 | usb_unlock_device(hdw->usb_dev); | 2888 | usb_unlock_device(hdw->usb_dev); |
@@ -2931,7 +2931,7 @@ int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *hdw) | |||
2931 | pvr2_trace(PVR2_TRACE_INIT,"Requesting uproc hard reset"); | 2931 | pvr2_trace(PVR2_TRACE_INIT,"Requesting uproc hard reset"); |
2932 | hdw->flag_ok = !0; | 2932 | hdw->flag_ok = !0; |
2933 | hdw->cmd_buffer[0] = 0xdd; | 2933 | hdw->cmd_buffer[0] = 0xdd; |
2934 | status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); | 2934 | status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); |
2935 | } while (0); LOCK_GIVE(hdw->ctl_lock); | 2935 | } while (0); LOCK_GIVE(hdw->ctl_lock); |
2936 | return status; | 2936 | return status; |
2937 | } | 2937 | } |
@@ -2943,7 +2943,7 @@ int pvr2_hdw_cmd_powerup(struct pvr2_hdw *hdw) | |||
2943 | LOCK_TAKE(hdw->ctl_lock); do { | 2943 | LOCK_TAKE(hdw->ctl_lock); do { |
2944 | pvr2_trace(PVR2_TRACE_INIT,"Requesting powerup"); | 2944 | pvr2_trace(PVR2_TRACE_INIT,"Requesting powerup"); |
2945 | hdw->cmd_buffer[0] = 0xde; | 2945 | hdw->cmd_buffer[0] = 0xde; |
2946 | status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); | 2946 | status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); |
2947 | } while (0); LOCK_GIVE(hdw->ctl_lock); | 2947 | } while (0); LOCK_GIVE(hdw->ctl_lock); |
2948 | return status; | 2948 | return status; |
2949 | } | 2949 | } |
@@ -2975,7 +2975,7 @@ static int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl) | |||
2975 | int status; | 2975 | int status; |
2976 | LOCK_TAKE(hdw->ctl_lock); do { | 2976 | LOCK_TAKE(hdw->ctl_lock); do { |
2977 | hdw->cmd_buffer[0] = (runFl ? 0x36 : 0x37); | 2977 | hdw->cmd_buffer[0] = (runFl ? 0x36 : 0x37); |
2978 | status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); | 2978 | status = pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); |
2979 | } while (0); LOCK_GIVE(hdw->ctl_lock); | 2979 | } while (0); LOCK_GIVE(hdw->ctl_lock); |
2980 | if (!status) { | 2980 | if (!status) { |
2981 | hdw->subsys_enabled_mask = | 2981 | hdw->subsys_enabled_mask = |