diff options
Diffstat (limited to 'drivers/media/pci/cx25821/cx25821-video-upstream.c')
-rw-r--r-- | drivers/media/pci/cx25821/cx25821-video-upstream.c | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/drivers/media/pci/cx25821/cx25821-video-upstream.c b/drivers/media/pci/cx25821/cx25821-video-upstream.c index 6759fff8eb64..7fc97110d973 100644 --- a/drivers/media/pci/cx25821/cx25821-video-upstream.c +++ b/drivers/media/pci/cx25821/cx25821-video-upstream.c @@ -173,10 +173,10 @@ static __le32 *cx25821_risc_field_upstream(struct cx25821_dev *dev, __le32 * rp, return rp; } -int cx25821_risc_buffer_upstream(struct cx25821_dev *dev, - struct pci_dev *pci, - unsigned int top_offset, - unsigned int bpl, unsigned int lines) +static int cx25821_risc_buffer_upstream(struct cx25821_dev *dev, + struct pci_dev *pci, + unsigned int top_offset, + unsigned int bpl, unsigned int lines) { __le32 *rp; int fifo_enable = 0; @@ -300,7 +300,8 @@ void cx25821_free_mem_upstream_ch1(struct cx25821_dev *dev) } } -int cx25821_get_frame(struct cx25821_dev *dev, struct sram_channel *sram_ch) +static int cx25821_get_frame(struct cx25821_dev *dev, + struct sram_channel *sram_ch) { struct file *myfile; int frame_index_temp = dev->_frame_index; @@ -405,7 +406,8 @@ static void cx25821_vidups_handler(struct work_struct *work) sram_channels); } -int cx25821_openfile(struct cx25821_dev *dev, struct sram_channel *sram_ch) +static int cx25821_openfile(struct cx25821_dev *dev, + struct sram_channel *sram_ch) { struct file *myfile; int i = 0, j = 0; @@ -486,8 +488,9 @@ int cx25821_openfile(struct cx25821_dev *dev, struct sram_channel *sram_ch) return 0; } -int cx25821_upstream_buffer_prepare(struct cx25821_dev *dev, - struct sram_channel *sram_ch, int bpl) +static int cx25821_upstream_buffer_prepare(struct cx25821_dev *dev, + struct sram_channel *sram_ch, + int bpl) { int ret = 0; dma_addr_t dma_addr; @@ -548,8 +551,8 @@ error: return ret; } -int cx25821_video_upstream_irq(struct cx25821_dev *dev, int chan_num, - u32 status) +static int cx25821_video_upstream_irq(struct cx25821_dev *dev, int chan_num, + u32 status) { u32 int_msk_tmp; struct sram_channel *channel = dev->channels[chan_num].sram_channels; @@ -664,8 +667,9 @@ static irqreturn_t cx25821_upstream_irq(int irq, void *dev_id) return IRQ_RETVAL(handled); } -void cx25821_set_pixelengine(struct cx25821_dev *dev, struct sram_channel *ch, - int pix_format) +static void cx25821_set_pixelengine(struct cx25821_dev *dev, + struct sram_channel *ch, + int pix_format) { int width = WIDTH_D1; int height = dev->_lines_count; @@ -696,8 +700,8 @@ void cx25821_set_pixelengine(struct cx25821_dev *dev, struct sram_channel *ch, cx_write(ch->vid_cdt_size, VID_CDT_SIZE >> 3); } -int cx25821_start_video_dma_upstream(struct cx25821_dev *dev, - struct sram_channel *sram_ch) +static int cx25821_start_video_dma_upstream(struct cx25821_dev *dev, + struct sram_channel *sram_ch) { u32 tmp = 0; int err = 0; @@ -753,7 +757,6 @@ int cx25821_vidupstream_init_ch1(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; @@ -796,15 +799,19 @@ int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select, dev->_filename = kmemdup(dev->input_filename, str_length + 1, GFP_KERNEL); - if (!dev->_filename) + if (!dev->_filename) { + err = -ENOENT; goto error; + } } else { str_length = strlen(dev->_defaultname); dev->_filename = kmemdup(dev->_defaultname, str_length + 1, GFP_KERNEL); - if (!dev->_filename) + if (!dev->_filename) { + err = -ENOENT; goto error; + } } /* Default if filename is empty string */ @@ -828,7 +835,7 @@ int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select, dev->_line_size = (dev->_pixel_format == PIXEL_FRMT_422) ? (WIDTH_D1 * 2) : (WIDTH_D1 * 3) / 2; - retval = cx25821_sram_channel_setup_upstream(dev, sram_ch, + err = cx25821_sram_channel_setup_upstream(dev, sram_ch, dev->_line_size, 0); /* setup fifo + format */ @@ -838,8 +845,8 @@ int cx25821_vidupstream_init_ch1(struct cx25821_dev *dev, int channel_select, dev->upstream_databuf_size = data_frame_size * 2; /* Allocating buffers and prepare RISC program */ - retval = cx25821_upstream_buffer_prepare(dev, sram_ch, dev->_line_size); - if (retval < 0) { + err = cx25821_upstream_buffer_prepare(dev, sram_ch, dev->_line_size); + if (err < 0) { pr_err("%s: Failed to set up Video upstream buffers!\n", dev->name); goto error; |