diff options
Diffstat (limited to 'drivers/media/usb/cx231xx/cx231xx-core.c')
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-core.c | 93 |
1 files changed, 36 insertions, 57 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c index 229e855..c5842a1 100644 --- a/drivers/media/usb/cx231xx/cx231xx-core.c +++ b/drivers/media/usb/cx231xx/cx231xx-core.c @@ -228,9 +228,8 @@ int cx231xx_send_usb_command(struct cx231xx_i2c *i2c_bus, /* call common vendor command request */ status = cx231xx_send_vendor_cmd(dev, &ven_req); if (status < 0) { - pr_info - ("UsbInterface::sendCommand, failed with status -%d\n", - status); + pr_err("%s: failed with status -%d\n", + __func__, status); } return status; @@ -524,9 +523,8 @@ int cx231xx_set_video_alternate(struct cx231xx *dev) usb_set_interface(dev->udev, usb_interface_index, dev->video_mode.alt); if (errCode < 0) { - pr_err - ("cannot change alt number to %d (error=%i)\n", - dev->video_mode.alt, errCode); + pr_err("cannot change alt number to %d (error=%i)\n", + dev->video_mode.alt, errCode); return errCode; } } @@ -600,9 +598,8 @@ int cx231xx_set_alt_setting(struct cx231xx *dev, u8 index, u8 alt) } if (alt > 0 && max_pkt_size == 0) { - pr_err - ("can't change interface %d alt no. to %d: Max. Pkt size = 0\n", - usb_interface_index, alt); + pr_err("can't change interface %d alt no. to %d: Max. Pkt size = 0\n", + usb_interface_index, alt); /*To workaround error number=-71 on EP0 for videograbber, need add following codes.*/ if (dev->board.no_alt_vanc) @@ -616,9 +613,8 @@ int cx231xx_set_alt_setting(struct cx231xx *dev, u8 index, u8 alt) if (usb_interface_index > 0) { status = usb_set_interface(dev->udev, usb_interface_index, alt); if (status < 0) { - pr_err - ("can't change interface %d alt no. to %d (err=%i)\n", - usb_interface_index, alt, status); + pr_err("can't change interface %d alt no. to %d (err=%i)\n", + usb_interface_index, alt, status); return status; } } @@ -767,17 +763,15 @@ int cx231xx_ep5_bulkout(struct cx231xx *dev, u8 *firmware, u16 size) u32 *buffer; buffer = kzalloc(4096, GFP_KERNEL); - if (buffer == NULL) { - pr_info("out of mem\n"); + if (buffer == NULL) return -ENOMEM; - } memcpy(&buffer[0], firmware, 4096); ret = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 5), buffer, 4096, &actlen, 2000); if (ret) - pr_info("bulk message failed: %d (%d/%d)", ret, + pr_err("bulk message failed: %d (%d/%d)", ret, size, actlen); else { errCode = actlen != size ? -1 : 0; @@ -987,12 +981,8 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets, cx231xx_uninit_isoc(dev); dma_q->p_left_data = kzalloc(4096, GFP_KERNEL); - if (dma_q->p_left_data == NULL) { - pr_info("out of mem\n"); + if (dma_q->p_left_data == NULL) return -ENOMEM; - } - - dev->video_mode.isoc_ctl.isoc_copy = isoc_copy; dev->video_mode.isoc_ctl.num_bufs = num_bufs; @@ -1055,10 +1045,9 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets, usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL, &urb->transfer_dma); if (!dev->video_mode.isoc_ctl.transfer_buffer[i]) { - pr_err("unable to allocate %i bytes for transfer" - " buffer %i%s\n", - sb_size, i, - in_interrupt() ? " while in int" : ""); + pr_err("unable to allocate %i bytes for transfer buffer %i%s\n", + sb_size, i, + in_interrupt() ? " while in int" : ""); cx231xx_uninit_isoc(dev); return -ENOMEM; } @@ -1091,7 +1080,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets, GFP_ATOMIC); if (rc) { pr_err("submit of urb %i failed (error=%i)\n", i, - rc); + rc); cx231xx_uninit_isoc(dev); return rc; } @@ -1189,10 +1178,9 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets, usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL, &urb->transfer_dma); if (!dev->video_mode.bulk_ctl.transfer_buffer[i]) { - pr_err("unable to allocate %i bytes for transfer" - " buffer %i%s\n", - sb_size, i, - in_interrupt() ? " while in int" : ""); + pr_err("unable to allocate %i bytes for transfer buffer %i%s\n", + sb_size, i, + in_interrupt() ? " while in int" : ""); cx231xx_uninit_bulk(dev); return -ENOMEM; } @@ -1212,8 +1200,7 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets, rc = usb_submit_urb(dev->video_mode.bulk_ctl.urb[i], GFP_ATOMIC); if (rc) { - pr_err("submit of urb %i failed (error=%i)\n", i, - rc); + pr_err("submit of urb %i failed (error=%i)\n", i,rc); cx231xx_uninit_bulk(dev); return rc; } @@ -1316,18 +1303,16 @@ int cx231xx_dev_init(struct cx231xx *dev) errCode = cx231xx_set_power_mode(dev, POLARIS_AVMODE_ENXTERNAL_AV); if (errCode < 0) { - pr_err - ("%s: Failed to set Power - errCode [%d]!\n", - __func__, errCode); + pr_err("%s: Failed to set Power - errCode [%d]!\n", + __func__, errCode); return errCode; } } else { errCode = cx231xx_set_power_mode(dev, POLARIS_AVMODE_ANALOGT_TV); if (errCode < 0) { - pr_err - ("%s: Failed to set Power - errCode [%d]!\n", - __func__, errCode); + pr_err("%s: Failed to set Power - errCode [%d]!\n", + __func__, errCode); return errCode; } } @@ -1340,34 +1325,30 @@ int cx231xx_dev_init(struct cx231xx *dev) /* initialize Colibri block */ errCode = cx231xx_afe_init_super_block(dev, 0x23c); if (errCode < 0) { - pr_err - ("%s: cx231xx_afe init super block - errCode [%d]!\n", - __func__, errCode); + pr_err("%s: cx231xx_afe init super block - errCode [%d]!\n", + __func__, errCode); return errCode; } errCode = cx231xx_afe_init_channels(dev); if (errCode < 0) { - pr_err - ("%s: cx231xx_afe init channels - errCode [%d]!\n", - __func__, errCode); + pr_err("%s: cx231xx_afe init channels - errCode [%d]!\n", + __func__, errCode); return errCode; } /* Set DIF in By pass mode */ errCode = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND); if (errCode < 0) { - pr_err - ("%s: cx231xx_dif set to By pass mode - errCode [%d]!\n", - __func__, errCode); + pr_err("%s: cx231xx_dif set to By pass mode - errCode [%d]!\n", + __func__, errCode); return errCode; } /* I2S block related functions */ errCode = cx231xx_i2s_blk_initialize(dev); if (errCode < 0) { - pr_err - ("%s: cx231xx_i2s block initialize - errCode [%d]!\n", - __func__, errCode); + pr_err("%s: cx231xx_i2s block initialize - errCode [%d]!\n", + __func__, errCode); return errCode; } @@ -1375,7 +1356,7 @@ int cx231xx_dev_init(struct cx231xx *dev) errCode = cx231xx_init_ctrl_pin_status(dev); if (errCode < 0) { pr_err("%s: cx231xx_init ctrl pins - errCode [%d]!\n", - __func__, errCode); + __func__, errCode); return errCode; } @@ -1400,9 +1381,8 @@ int cx231xx_dev_init(struct cx231xx *dev) break; } if (errCode < 0) { - pr_err - ("%s: cx231xx_AGC mode to Analog - errCode [%d]!\n", - __func__, errCode); + pr_err("%s: cx231xx_AGC mode to Analog - errCode [%d]!\n", + __func__, errCode); return errCode; } @@ -1477,9 +1457,8 @@ int cx231xx_send_gpio_cmd(struct cx231xx *dev, u32 gpio_bit, u8 *gpio_val, /* call common vendor command request */ status = cx231xx_send_vendor_cmd(dev, &ven_req); if (status < 0) { - pr_info - ("UsbInterface::sendCommand, failed with status -%d\n", - status); + pr_err("%s: failed with status -%d\n", + __func__, status); } return status; |