diff options
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 1c79ce1e16c4..7f9168538245 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -1934,20 +1934,18 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, | |||
1934 | return NULL; | 1934 | return NULL; |
1935 | } | 1935 | } |
1936 | 1936 | ||
1937 | hdw = kmalloc(sizeof(*hdw),GFP_KERNEL); | 1937 | hdw = kzalloc(sizeof(*hdw),GFP_KERNEL); |
1938 | pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p, type \"%s\"", | 1938 | pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p, type \"%s\"", |
1939 | hdw,pvr2_device_names[hdw_type]); | 1939 | hdw,pvr2_device_names[hdw_type]); |
1940 | if (!hdw) goto fail; | 1940 | if (!hdw) goto fail; |
1941 | memset(hdw,0,sizeof(*hdw)); | ||
1942 | hdw->tuner_signal_stale = !0; | 1941 | hdw->tuner_signal_stale = !0; |
1943 | cx2341x_fill_defaults(&hdw->enc_ctl_state); | 1942 | cx2341x_fill_defaults(&hdw->enc_ctl_state); |
1944 | 1943 | ||
1945 | hdw->control_cnt = CTRLDEF_COUNT; | 1944 | hdw->control_cnt = CTRLDEF_COUNT; |
1946 | hdw->control_cnt += MPEGDEF_COUNT; | 1945 | hdw->control_cnt += MPEGDEF_COUNT; |
1947 | hdw->controls = kmalloc(sizeof(struct pvr2_ctrl) * hdw->control_cnt, | 1946 | hdw->controls = kzalloc(sizeof(struct pvr2_ctrl) * hdw->control_cnt, |
1948 | GFP_KERNEL); | 1947 | GFP_KERNEL); |
1949 | if (!hdw->controls) goto fail; | 1948 | if (!hdw->controls) goto fail; |
1950 | memset(hdw->controls,0,sizeof(struct pvr2_ctrl) * hdw->control_cnt); | ||
1951 | hdw->hdw_type = hdw_type; | 1949 | hdw->hdw_type = hdw_type; |
1952 | for (idx = 0; idx < hdw->control_cnt; idx++) { | 1950 | for (idx = 0; idx < hdw->control_cnt; idx++) { |
1953 | cptr = hdw->controls + idx; | 1951 | cptr = hdw->controls + idx; |
@@ -1961,11 +1959,9 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, | |||
1961 | cptr->info = control_defs+idx; | 1959 | cptr->info = control_defs+idx; |
1962 | } | 1960 | } |
1963 | /* Define and configure additional controls from cx2341x module. */ | 1961 | /* Define and configure additional controls from cx2341x module. */ |
1964 | hdw->mpeg_ctrl_info = kmalloc( | 1962 | hdw->mpeg_ctrl_info = kzalloc( |
1965 | sizeof(*(hdw->mpeg_ctrl_info)) * MPEGDEF_COUNT, GFP_KERNEL); | 1963 | sizeof(*(hdw->mpeg_ctrl_info)) * MPEGDEF_COUNT, GFP_KERNEL); |
1966 | if (!hdw->mpeg_ctrl_info) goto fail; | 1964 | if (!hdw->mpeg_ctrl_info) goto fail; |
1967 | memset(hdw->mpeg_ctrl_info,0, | ||
1968 | sizeof(*(hdw->mpeg_ctrl_info)) * MPEGDEF_COUNT); | ||
1969 | for (idx = 0; idx < MPEGDEF_COUNT; idx++) { | 1965 | for (idx = 0; idx < MPEGDEF_COUNT; idx++) { |
1970 | cptr = hdw->controls + idx + CTRLDEF_COUNT; | 1966 | cptr = hdw->controls + idx + CTRLDEF_COUNT; |
1971 | ciptr = &(hdw->mpeg_ctrl_info[idx].info); | 1967 | ciptr = &(hdw->mpeg_ctrl_info[idx].info); |
@@ -2608,14 +2604,12 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, int enable_flag) | |||
2608 | pvr2_trace(PVR2_TRACE_FIRMWARE, | 2604 | pvr2_trace(PVR2_TRACE_FIRMWARE, |
2609 | "Preparing to suck out CPU firmware"); | 2605 | "Preparing to suck out CPU firmware"); |
2610 | hdw->fw_size = 0x2000; | 2606 | hdw->fw_size = 0x2000; |
2611 | hdw->fw_buffer = kmalloc(hdw->fw_size,GFP_KERNEL); | 2607 | hdw->fw_buffer = kzalloc(hdw->fw_size,GFP_KERNEL); |
2612 | if (!hdw->fw_buffer) { | 2608 | if (!hdw->fw_buffer) { |
2613 | hdw->fw_size = 0; | 2609 | hdw->fw_size = 0; |
2614 | break; | 2610 | break; |
2615 | } | 2611 | } |
2616 | 2612 | ||
2617 | memset(hdw->fw_buffer,0,hdw->fw_size); | ||
2618 | |||
2619 | /* We have to hold the CPU during firmware upload. */ | 2613 | /* We have to hold the CPU during firmware upload. */ |
2620 | pvr2_hdw_cpureset_assert(hdw,1); | 2614 | pvr2_hdw_cpureset_assert(hdw,1); |
2621 | 2615 | ||