diff options
Diffstat (limited to 'drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c')
-rw-r--r-- | drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c b/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c index d33fc1a23030..cf2723c7197f 100644 --- a/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c +++ b/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c @@ -123,10 +123,11 @@ static __le32 *cx25821_risc_field_upstream_ch2(struct cx25821_dev *dev, return rp; } -int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev *dev, - struct pci_dev *pci, - unsigned int top_offset, unsigned int bpl, - unsigned int lines) +static int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev *dev, + struct pci_dev *pci, + unsigned int top_offset, + unsigned int bpl, + unsigned int lines) { __le32 *rp; int fifo_enable = 0; @@ -255,7 +256,8 @@ void cx25821_free_mem_upstream_ch2(struct cx25821_dev *dev) } } -int cx25821_get_frame_ch2(struct cx25821_dev *dev, struct sram_channel *sram_ch) +static int cx25821_get_frame_ch2(struct cx25821_dev *dev, + struct sram_channel *sram_ch) { struct file *myfile; int frame_index_temp = dev->_frame_index_ch2; @@ -360,7 +362,8 @@ static void cx25821_vidups_handler_ch2(struct work_struct *work) _channel2_upstream_select].sram_channels); } -int cx25821_openfile_ch2(struct cx25821_dev *dev, struct sram_channel *sram_ch) +static int cx25821_openfile_ch2(struct cx25821_dev *dev, + struct sram_channel *sram_ch) { struct file *myfile; int i = 0, j = 0; @@ -507,8 +510,9 @@ error: return ret; } -int cx25821_video_upstream_irq_ch2(struct cx25821_dev *dev, int chan_num, - u32 status) +static int cx25821_video_upstream_irq_ch2(struct cx25821_dev *dev, + int chan_num, + u32 status) { u32 int_msk_tmp; struct sram_channel *channel = dev->channels[chan_num].sram_channels; @@ -647,8 +651,8 @@ static void cx25821_set_pixelengine_ch2(struct cx25821_dev *dev, cx_write(ch->vid_cdt_size, VID_CDT_SIZE >> 3); } -int cx25821_start_video_dma_upstream_ch2(struct cx25821_dev *dev, - struct sram_channel *sram_ch) +static int cx25821_start_video_dma_upstream_ch2(struct cx25821_dev *dev, + struct sram_channel *sram_ch) { u32 tmp = 0; int err = 0; @@ -704,11 +708,9 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select, { struct sram_channel *sram_ch; u32 tmp; - int retval = 0; int err = 0; int data_frame_size = 0; int risc_buffer_size = 0; - int str_length = 0; if (dev->_is_running_ch2) { pr_info("Video Channel is still running so return!\n"); @@ -744,20 +746,16 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select, risc_buffer_size = dev->_isNTSC_ch2 ? NTSC_RISC_BUF_SIZE : PAL_RISC_BUF_SIZE; - if (dev->input_filename_ch2) { - str_length = strlen(dev->input_filename_ch2); - dev->_filename_ch2 = kmemdup(dev->input_filename_ch2, - str_length + 1, GFP_KERNEL); - - if (!dev->_filename_ch2) - goto error; - } else { - str_length = strlen(dev->_defaultname_ch2); - dev->_filename_ch2 = kmemdup(dev->_defaultname_ch2, - str_length + 1, GFP_KERNEL); + if (dev->input_filename_ch2) + dev->_filename_ch2 = kstrdup(dev->input_filename_ch2, + GFP_KERNEL); + else + dev->_filename_ch2 = kstrdup(dev->_defaultname_ch2, + GFP_KERNEL); - if (!dev->_filename_ch2) - goto error; + if (!dev->_filename_ch2) { + err = -ENOENT; + goto error; } /* Default if filename is empty string */ @@ -773,7 +771,7 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select, } } - retval = cx25821_sram_channel_setup_upstream(dev, sram_ch, + err = cx25821_sram_channel_setup_upstream(dev, sram_ch, dev->_line_size_ch2, 0); /* setup fifo + format */ @@ -783,9 +781,9 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select, dev->upstream_databuf_size_ch2 = data_frame_size * 2; /* Allocating buffers and prepare RISC program */ - retval = cx25821_upstream_buffer_prepare_ch2(dev, sram_ch, + err = cx25821_upstream_buffer_prepare_ch2(dev, sram_ch, dev->_line_size_ch2); - if (retval < 0) { + if (err < 0) { pr_err("%s: Failed to set up Video upstream buffers!\n", dev->name); goto error; |