summaryrefslogtreecommitdiff
path: root/drivers/media/usb/cx231xx/cx231xx-video.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-video.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-video.c')
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-video.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c
index c5b5e9541669..4c5bba2e89f4 100644
--- a/drivers/media/usb/cx231xx/cx231xx-video.c
+++ b/drivers/media/usb/cx231xx/cx231xx-video.c
@@ -736,7 +736,7 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb,
if (!dev->video_mode.bulk_ctl.num_bufs)
urb_init = 1;
}
- dev_dbg(&dev->udev->dev,
+ dev_dbg(dev->dev,
"urb_init=%d dev->video_mode.max_pkt_size=%d\n",
urb_init, dev->video_mode.max_pkt_size);
if (urb_init) {
@@ -809,7 +809,7 @@ void video_mux(struct cx231xx *dev, int index)
cx231xx_set_audio_input(dev, dev->ctl_ainput);
- dev_dbg(&dev->udev->dev, "video_mux : %d\n", index);
+ dev_dbg(dev->dev, "video_mux : %d\n", index);
/* do mode control overrides if required */
cx231xx_do_mode_ctrl_overrides(dev);
@@ -861,7 +861,7 @@ static void res_free(struct cx231xx_fh *fh)
static int check_dev(struct cx231xx *dev)
{
if (dev->state & DEV_DISCONNECTED) {
- dev_err(&dev->udev->dev, "v4l2 ioctl: device not present\n");
+ dev_err(dev->dev, "v4l2 ioctl: device not present\n");
return -ENODEV;
}
return 0;
@@ -953,12 +953,12 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
return -EINVAL;
if (videobuf_queue_is_busy(&fh->vb_vidq)) {
- dev_err(&dev->udev->dev, "%s: queue busy\n", __func__);
+ dev_err(dev->dev, "%s: queue busy\n", __func__);
return -EBUSY;
}
if (dev->stream_on && !fh->stream_on) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"%s: device in use by another fh\n", __func__);
return -EBUSY;
}
@@ -1177,7 +1177,7 @@ int cx231xx_s_frequency(struct file *file, void *priv,
int rc;
u32 if_frequency = 5400000;
- dev_dbg(&dev->udev->dev,
+ dev_dbg(dev->dev,
"Enter vidioc_s_frequency()f->frequency=%d;f->type=%d\n",
f->frequency, f->type);
@@ -1214,14 +1214,14 @@ int cx231xx_s_frequency(struct file *file, void *priv,
else if (dev->norm & V4L2_STD_SECAM_LC)
if_frequency = 1250000; /*1.25MHz */
- dev_dbg(&dev->udev->dev,
+ dev_dbg(dev->dev,
"if_frequency is set to %d\n", if_frequency);
cx231xx_set_Colibri_For_LowIF(dev, if_frequency, 1, 1);
update_HH_register_after_set_DIF(dev);
}
- dev_dbg(&dev->udev->dev, "Set New FREQUENCY to %d\n", f->frequency);
+ dev_dbg(dev->dev, "Set New FREQUENCY to %d\n", f->frequency);
return rc;
}
@@ -1525,7 +1525,7 @@ static int vidioc_s_fmt_vbi_cap(struct file *file, void *priv,
struct cx231xx *dev = fh->dev;
if (dev->vbi_stream_on && !fh->stream_on) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"%s device in use by another fh\n", __func__);
return -EBUSY;
}
@@ -1645,7 +1645,7 @@ static int cx231xx_v4l2_open(struct file *filp)
#if 0
errCode = cx231xx_set_mode(dev, CX231XX_ANALOG_MODE);
if (errCode < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"Device locked on digital mode. Can't open analog\n");
return -EBUSY;
}
@@ -1737,7 +1737,7 @@ void cx231xx_release_analog_resources(struct cx231xx *dev)
dev->radio_dev = NULL;
}
if (dev->vbi_dev) {
- dev_info(&dev->udev->dev, "V4L2 device %s deregistered\n",
+ dev_info(dev->dev, "V4L2 device %s deregistered\n",
video_device_node_name(dev->vbi_dev));
if (video_is_registered(dev->vbi_dev))
video_unregister_device(dev->vbi_dev);
@@ -1746,7 +1746,7 @@ void cx231xx_release_analog_resources(struct cx231xx *dev)
dev->vbi_dev = NULL;
}
if (dev->vdev) {
- dev_info(&dev->udev->dev, "V4L2 device %s deregistered\n",
+ dev_info(dev->dev, "V4L2 device %s deregistered\n",
video_device_node_name(dev->vdev));
if (dev->board.has_417)
@@ -2081,7 +2081,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
{
int ret;
- dev_info(&dev->udev->dev, "v4l2 driver version %s\n", CX231XX_VERSION);
+ dev_info(dev->dev, "v4l2 driver version %s\n", CX231XX_VERSION);
/* set default norm */
dev->norm = V4L2_STD_PAL;
@@ -2119,7 +2119,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
/* allocate and fill video video_device struct */
dev->vdev = cx231xx_vdev_init(dev, &cx231xx_video_template, "video");
if (!dev->vdev) {
- dev_err(&dev->udev->dev, "cannot allocate video_device.\n");
+ dev_err(dev->dev, "cannot allocate video_device.\n");
return -ENODEV;
}
@@ -2128,13 +2128,13 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
ret = video_register_device(dev->vdev, VFL_TYPE_GRABBER,
video_nr[dev->devno]);
if (ret) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"unable to register video device (error=%i).\n",
ret);
return ret;
}
- dev_info(&dev->udev->dev, "Registered video device %s [v4l2]\n",
+ dev_info(dev->dev, "Registered video device %s [v4l2]\n",
video_device_node_name(dev->vdev));
/* Initialize VBI template */
@@ -2145,7 +2145,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
dev->vbi_dev = cx231xx_vdev_init(dev, &cx231xx_vbi_template, "vbi");
if (!dev->vbi_dev) {
- dev_err(&dev->udev->dev, "cannot allocate video_device.\n");
+ dev_err(dev->dev, "cannot allocate video_device.\n");
return -ENODEV;
}
dev->vbi_dev->ctrl_handler = &dev->ctrl_handler;
@@ -2153,18 +2153,18 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
ret = video_register_device(dev->vbi_dev, VFL_TYPE_VBI,
vbi_nr[dev->devno]);
if (ret < 0) {
- dev_err(&dev->udev->dev, "unable to register vbi device\n");
+ dev_err(dev->dev, "unable to register vbi device\n");
return ret;
}
- dev_info(&dev->udev->dev, "Registered VBI device %s\n",
+ dev_info(dev->dev, "Registered VBI device %s\n",
video_device_node_name(dev->vbi_dev));
if (cx231xx_boards[dev->model].radio.type == CX231XX_RADIO) {
dev->radio_dev = cx231xx_vdev_init(dev, &cx231xx_radio_template,
"radio");
if (!dev->radio_dev) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"cannot allocate video_device.\n");
return -ENODEV;
}
@@ -2172,11 +2172,11 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
ret = video_register_device(dev->radio_dev, VFL_TYPE_RADIO,
radio_nr[dev->devno]);
if (ret < 0) {
- dev_err(&dev->udev->dev,
+ dev_err(dev->dev,
"can't register radio device\n");
return ret;
}
- dev_info(&dev->udev->dev, "Registered radio device as %s\n",
+ dev_info(dev->dev, "Registered radio device as %s\n",
video_device_node_name(dev->radio_dev));
}