summaryrefslogtreecommitdiff
path: root/drivers/media/usb/cx231xx/cx231xx-core.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-03 06:07:38 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-03 15:59:59 -0200
commit336fea922936c114f68b8c0bcbff5fcfac3507d9 (patch)
treee196bb60d2c661f18b805f4e557e7179b08bdc71 /drivers/media/usb/cx231xx/cx231xx-core.c
parentac550faabd7cc63f3726e21063931cb0d286c59d (diff)
[media] cx231xx: Improve the log message
Unfortunately, on devices that have multiple interfaces, udev->dev points to the parent device (usb) instead of the cx231xx specific one. Due to that the logs don't look too nice, as they'll print messages as if they were produced by USB core: usb-1-2: New device Conexant Corporation Polaris AV Capturb @ 480 Mbps (1554:5010) with 7 interfaces Instead of using the name of the parent device, let's use the name of the first cx231xx interface for all cx231xx sub-modules. With this path, the logs will be nicer: cx231xx 1-2:1.1: New device Conexant Corporation Polaris AV Capturb @ 480 Mbps (1554:5010) with 7 interfaces Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/cx231xx/cx231xx-core.c')
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-core.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c
index 64e907f02a02..4a3f28c4e8d3 100644
--- a/drivers/media/usb/cx231xx/cx231xx-core.c
+++ b/drivers/media/usb/cx231xx/cx231xx-core.c
@@ -100,7 +100,7 @@ int cx231xx_register_extension(struct cx231xx_ops *ops)
list_add_tail(&ops->next, &cx231xx_extension_devlist);
list_for_each_entry(dev, &cx231xx_devlist, devlist) {
ops->init(dev);
- dev_info(&dev->udev->dev, "%s initialized\n", ops->name);
+ dev_info(dev->dev, "%s initialized\n", ops->name);
}
mutex_unlock(&cx231xx_devlist_mutex);
return 0;
@@ -114,7 +114,7 @@ void cx231xx_unregister_extension(struct cx231xx_ops *ops)
mutex_lock(&cx231xx_devlist_mutex);
list_for_each_entry(dev, &cx231xx_devlist, devlist) {
ops->fini(dev);
- dev_info(&dev->udev->dev, "%s removed\n", ops->name);
+ dev_info(dev->dev, "%s removed\n", ops->name);
}
list_del(&ops->next);
@@ -227,7 +227,7 @@ 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 && !dev->i2c_scan_running) {
- dev_err(&dev->udev->dev, "%s: failed with status -%d\n",
+ dev_err(dev->dev, "%s: failed with status -%d\n",
__func__, status);
}
@@ -522,7 +522,7 @@ int cx231xx_set_video_alternate(struct cx231xx *dev)
usb_set_interface(dev->udev, usb_interface_index,
dev->video_mode.alt);
if (errCode < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"cannot change alt number to %d (error=%i)\n",
dev->video_mode.alt, errCode);
return errCode;
@@ -598,7 +598,7 @@ int cx231xx_set_alt_setting(struct cx231xx *dev, u8 index, u8 alt)
}
if (alt > 0 && max_pkt_size == 0) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"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,
@@ -614,7 +614,7 @@ 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) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"can't change interface %d alt no. to %d (err=%i)\n",
usb_interface_index, alt, status);
return status;
@@ -773,7 +773,7 @@ int cx231xx_ep5_bulkout(struct cx231xx *dev, u8 *firmware, u16 size)
buffer, 4096, &actlen, 2000);
if (ret)
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"bulk message failed: %d (%d/%d)", ret,
size, actlen);
else {
@@ -1011,7 +1011,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
dev->video_mode.isoc_ctl.urb =
kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
if (!dev->video_mode.isoc_ctl.urb) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"cannot alloc memory for usb buffers\n");
return -ENOMEM;
}
@@ -1019,7 +1019,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
dev->video_mode.isoc_ctl.transfer_buffer =
kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
if (!dev->video_mode.isoc_ctl.transfer_buffer) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"cannot allocate memory for usbtransfer\n");
kfree(dev->video_mode.isoc_ctl.urb);
return -ENOMEM;
@@ -1040,7 +1040,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
for (i = 0; i < dev->video_mode.isoc_ctl.num_bufs; i++) {
urb = usb_alloc_urb(max_packets, GFP_KERNEL);
if (!urb) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"cannot alloc isoc_ctl.urb %i\n", i);
cx231xx_uninit_isoc(dev);
return -ENOMEM;
@@ -1051,7 +1051,7 @@ 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]) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"unable to allocate %i bytes for transfer buffer %i%s\n",
sb_size, i,
in_interrupt() ? " while in int" : "");
@@ -1086,7 +1086,7 @@ int cx231xx_init_isoc(struct cx231xx *dev, int max_packets,
rc = usb_submit_urb(dev->video_mode.isoc_ctl.urb[i],
GFP_ATOMIC);
if (rc) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"submit of urb %i failed (error=%i)\n", i,
rc);
cx231xx_uninit_isoc(dev);
@@ -1148,7 +1148,7 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
dev->video_mode.bulk_ctl.urb =
kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
if (!dev->video_mode.bulk_ctl.urb) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"cannot alloc memory for usb buffers\n");
return -ENOMEM;
}
@@ -1156,7 +1156,7 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
dev->video_mode.bulk_ctl.transfer_buffer =
kzalloc(sizeof(void *) * num_bufs, GFP_KERNEL);
if (!dev->video_mode.bulk_ctl.transfer_buffer) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"cannot allocate memory for usbtransfer\n");
kfree(dev->video_mode.bulk_ctl.urb);
return -ENOMEM;
@@ -1177,7 +1177,7 @@ int cx231xx_init_bulk(struct cx231xx *dev, int max_packets,
for (i = 0; i < dev->video_mode.bulk_ctl.num_bufs; i++) {
urb = usb_alloc_urb(0, GFP_KERNEL);
if (!urb) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"cannot alloc bulk_ctl.urb %i\n", i);
cx231xx_uninit_bulk(dev);
return -ENOMEM;
@@ -1189,7 +1189,7 @@ 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]) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"unable to allocate %i bytes for transfer buffer %i%s\n",
sb_size, i,
in_interrupt() ? " while in int" : "");
@@ -1212,7 +1212,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) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"submit of urb %i failed (error=%i)\n", i, rc);
cx231xx_uninit_bulk(dev);
return rc;
@@ -1316,7 +1316,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
errCode = cx231xx_set_power_mode(dev,
POLARIS_AVMODE_ENXTERNAL_AV);
if (errCode < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"%s: Failed to set Power - errCode [%d]!\n",
__func__, errCode);
return errCode;
@@ -1325,7 +1325,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
errCode = cx231xx_set_power_mode(dev,
POLARIS_AVMODE_ANALOGT_TV);
if (errCode < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"%s: Failed to set Power - errCode [%d]!\n",
__func__, errCode);
return errCode;
@@ -1340,14 +1340,14 @@ int cx231xx_dev_init(struct cx231xx *dev)
/* initialize Colibri block */
errCode = cx231xx_afe_init_super_block(dev, 0x23c);
if (errCode < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"%s: cx231xx_afe init super block - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
errCode = cx231xx_afe_init_channels(dev);
if (errCode < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"%s: cx231xx_afe init channels - errCode [%d]!\n",
__func__, errCode);
return errCode;
@@ -1356,7 +1356,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
/* Set DIF in By pass mode */
errCode = cx231xx_dif_set_standard(dev, DIF_USE_BASEBAND);
if (errCode < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"%s: cx231xx_dif set to By pass mode - errCode [%d]!\n",
__func__, errCode);
return errCode;
@@ -1365,7 +1365,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
/* I2S block related functions */
errCode = cx231xx_i2s_blk_initialize(dev);
if (errCode < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"%s: cx231xx_i2s block initialize - errCode [%d]!\n",
__func__, errCode);
return errCode;
@@ -1374,7 +1374,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
/* init control pins */
errCode = cx231xx_init_ctrl_pin_status(dev);
if (errCode < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"%s: cx231xx_init ctrl pins - errCode [%d]!\n",
__func__, errCode);
return errCode;
@@ -1401,7 +1401,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
break;
}
if (errCode < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"%s: cx231xx_AGC mode to Analog - errCode [%d]!\n",
__func__, errCode);
return errCode;
@@ -1478,7 +1478,7 @@ 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) {
- dev_err(&dev->udev->dev, "%s: failed with status -%d\n",
+ dev_err(dev->dev, "%s: failed with status -%d\n",
__func__, status);
}