aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2009-12-10 08:47:13 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-15 21:17:57 -0500
commit50462eb065e12f45851a9959a90d46b758944552 (patch)
treefea5b79f1852183c5eaa3f079d5054dc78a828fa /drivers/media
parent63b0d5ad20365edf8baf96cdbb8e7faf62501286 (diff)
V4L/DVB (13555): v4l: Use video_device_node_name() instead of the minor number
Instead of using the minor number in kernel log messages, use the device node name as returned by the video_device_node_name() function. This makes debug, informational and error messages easier to understand for end users. [mchehab.redhat.com: removed tm6000 changes as tm6000 is not ready yet for submission even on staging] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/common/saa7146_fops.c3
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c6
-rw-r--r--drivers/media/video/cx18/cx18-fileops.c4
-rw-r--r--drivers/media/video/cx231xx/cx231xx-video.c6
-rw-r--r--drivers/media/video/cx23885/cx23885-video.c5
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c4
-rw-r--r--drivers/media/video/cx88/cx88-video.c5
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c6
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.c4
-rw-r--r--drivers/media/video/ov511.c4
-rw-r--r--drivers/media/video/s2255drv.c17
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c4
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c5
-rw-r--r--drivers/media/video/vivi.c7
14 files changed, 40 insertions, 40 deletions
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c
index 2d9fc2435f2b..3c11cff00475 100644
--- a/drivers/media/common/saa7146_fops.c
+++ b/drivers/media/common/saa7146_fops.c
@@ -194,7 +194,6 @@ void saa7146_buffer_timeout(unsigned long data)
194 194
195static int fops_open(struct file *file) 195static int fops_open(struct file *file)
196{ 196{
197 unsigned int minor = video_devdata(file)->minor;
198 struct video_device *vdev = video_devdata(file); 197 struct video_device *vdev = video_devdata(file);
199 struct saa7146_dev *dev = video_drvdata(file); 198 struct saa7146_dev *dev = video_drvdata(file);
200 struct saa7146_fh *fh = NULL; 199 struct saa7146_fh *fh = NULL;
@@ -202,7 +201,7 @@ static int fops_open(struct file *file)
202 201
203 enum v4l2_buf_type type; 202 enum v4l2_buf_type type;
204 203
205 DEB_EE(("file:%p, minor:%d\n", file, minor)); 204 DEB_EE(("file:%p, dev:%s\n", file, video_device_node_name(vdev)));
206 205
207 if (mutex_lock_interruptible(&saa7146_devices_lock)) 206 if (mutex_lock_interruptible(&saa7146_devices_lock))
208 return -ERESTARTSYS; 207 return -ERESTARTSYS;
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index a2336915ca70..dcad2f7a995c 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3207,11 +3207,12 @@ err:
3207static int bttv_open(struct file *file) 3207static int bttv_open(struct file *file)
3208{ 3208{
3209 int minor = video_devdata(file)->minor; 3209 int minor = video_devdata(file)->minor;
3210 struct video_device *vdev = video_devdata(file);
3210 struct bttv *btv = video_drvdata(file); 3211 struct bttv *btv = video_drvdata(file);
3211 struct bttv_fh *fh; 3212 struct bttv_fh *fh;
3212 enum v4l2_buf_type type = 0; 3213 enum v4l2_buf_type type = 0;
3213 3214
3214 dprintk(KERN_DEBUG "bttv: open minor=%d\n",minor); 3215 dprintk(KERN_DEBUG "bttv: open dev=%s\n", video_device_node_name(vdev));
3215 3216
3216 lock_kernel(); 3217 lock_kernel();
3217 if (btv->video_dev->minor == minor) { 3218 if (btv->video_dev->minor == minor) {
@@ -3409,10 +3410,11 @@ static struct video_device bttv_video_template = {
3409static int radio_open(struct file *file) 3410static int radio_open(struct file *file)
3410{ 3411{
3411 int minor = video_devdata(file)->minor; 3412 int minor = video_devdata(file)->minor;
3413 struct video_device *vdev = video_devdata(file);
3412 struct bttv *btv = video_drvdata(file); 3414 struct bttv *btv = video_drvdata(file);
3413 struct bttv_fh *fh; 3415 struct bttv_fh *fh;
3414 3416
3415 dprintk("bttv: open minor=%d\n",minor); 3417 dprintk("bttv: open dev=%s\n", video_device_node_name(vdev));
3416 3418
3417 lock_kernel(); 3419 lock_kernel();
3418 WARN_ON(btv->radio_dev && btv->radio_dev->minor != minor); 3420 WARN_ON(btv->radio_dev && btv->radio_dev->minor != minor);
diff --git a/drivers/media/video/cx18/cx18-fileops.c b/drivers/media/video/cx18/cx18-fileops.c
index 4e278db31cc9..c0885c69fd89 100644
--- a/drivers/media/video/cx18/cx18-fileops.c
+++ b/drivers/media/video/cx18/cx18-fileops.c
@@ -758,8 +758,8 @@ int cx18_v4l2_open(struct file *filp)
758 758
759 mutex_lock(&cx->serialize_lock); 759 mutex_lock(&cx->serialize_lock);
760 if (cx18_init_on_first_open(cx)) { 760 if (cx18_init_on_first_open(cx)) {
761 CX18_ERR("Failed to initialize on minor %d\n", 761 CX18_ERR("Failed to initialize on %s\n",
762 video_dev->minor); 762 video_device_node_name(video_dev));
763 mutex_unlock(&cx->serialize_lock); 763 mutex_unlock(&cx->serialize_lock);
764 return -ENXIO; 764 return -ENXIO;
765 } 765 }
diff --git a/drivers/media/video/cx231xx/cx231xx-video.c b/drivers/media/video/cx231xx/cx231xx-video.c
index 3fc7a6fe8554..552dff5d6f1d 100644
--- a/drivers/media/video/cx231xx/cx231xx-video.c
+++ b/drivers/media/video/cx231xx/cx231xx-video.c
@@ -1916,7 +1916,6 @@ static int radio_queryctrl(struct file *file, void *priv,
1916 */ 1916 */
1917static int cx231xx_v4l2_open(struct file *filp) 1917static int cx231xx_v4l2_open(struct file *filp)
1918{ 1918{
1919 int minor = video_devdata(filp)->minor;
1920 int errCode = 0, radio = 0; 1919 int errCode = 0, radio = 0;
1921 struct video_device *vdev = video_devdata(filp); 1920 struct video_device *vdev = video_devdata(filp);
1922 struct cx231xx *dev = video_drvdata(filp); 1921 struct cx231xx *dev = video_drvdata(filp);
@@ -1937,8 +1936,9 @@ static int cx231xx_v4l2_open(struct file *filp)
1937 1936
1938 mutex_lock(&dev->lock); 1937 mutex_lock(&dev->lock);
1939 1938
1940 cx231xx_videodbg("open minor=%d type=%s users=%d\n", 1939 cx231xx_videodbg("open dev=%s type=%s users=%d\n",
1941 minor, v4l2_type_names[fh_type], dev->users); 1940 video_device_node_name(vdev), v4l2_type_names[fh_type],
1941 dev->users);
1942 1942
1943#if 0 1943#if 0
1944 errCode = cx231xx_set_mode(dev, CX231XX_ANALOG_MODE); 1944 errCode = cx231xx_set_mode(dev, CX231XX_ANALOG_MODE);
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c
index e10f28cfef5e..e8ca8bb384d2 100644
--- a/drivers/media/video/cx23885/cx23885-video.c
+++ b/drivers/media/video/cx23885/cx23885-video.c
@@ -717,7 +717,6 @@ static int get_resource(struct cx23885_fh *fh)
717 717
718static int video_open(struct file *file) 718static int video_open(struct file *file)
719{ 719{
720 int minor = video_devdata(file)->minor;
721 struct video_device *vdev = video_devdata(file); 720 struct video_device *vdev = video_devdata(file);
722 struct cx23885_dev *dev = video_drvdata(file); 721 struct cx23885_dev *dev = video_drvdata(file);
723 struct cx23885_fh *fh; 722 struct cx23885_fh *fh;
@@ -736,8 +735,8 @@ static int video_open(struct file *file)
736 break; 735 break;
737 } 736 }
738 737
739 dprintk(1, "open minor=%d radio=%d type=%s\n", 738 dprintk(1, "open dev=%s radio=%d type=%s\n",
740 minor, radio, v4l2_type_names[type]); 739 video_device_node_name(vdev), radio, v4l2_type_names[type]);
741 740
742 /* allocate + initialize per filehandle data */ 741 /* allocate + initialize per filehandle data */
743 fh = kzalloc(sizeof(*fh), GFP_KERNEL); 742 fh = kzalloc(sizeof(*fh), GFP_KERNEL);
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index f0ef94150d1e..03e592e016fe 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -1048,7 +1048,7 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id)
1048 1048
1049static int mpeg_open(struct file *file) 1049static int mpeg_open(struct file *file)
1050{ 1050{
1051 int minor = video_devdata(file)->minor; 1051 struct video_device *vdev = video_devdata(file);
1052 struct cx8802_dev *dev = video_drvdata(file); 1052 struct cx8802_dev *dev = video_drvdata(file);
1053 struct cx8802_fh *fh; 1053 struct cx8802_fh *fh;
1054 struct cx8802_driver *drv = NULL; 1054 struct cx8802_driver *drv = NULL;
@@ -1075,7 +1075,7 @@ static int mpeg_open(struct file *file)
1075 unlock_kernel(); 1075 unlock_kernel();
1076 return -EINVAL; 1076 return -EINVAL;
1077 } 1077 }
1078 dprintk(1,"open minor=%d\n",minor); 1078 dprintk(1, "open dev=%s\n", video_device_node_name(vdev));
1079 1079
1080 /* allocate + initialize per filehandle data */ 1080 /* allocate + initialize per filehandle data */
1081 fh = kzalloc(sizeof(*fh),GFP_KERNEL); 1081 fh = kzalloc(sizeof(*fh),GFP_KERNEL);
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 758399173a52..0013cb4d756a 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -749,7 +749,6 @@ static int get_ressource(struct cx8800_fh *fh)
749 749
750static int video_open(struct file *file) 750static int video_open(struct file *file)
751{ 751{
752 int minor = video_devdata(file)->minor;
753 struct video_device *vdev = video_devdata(file); 752 struct video_device *vdev = video_devdata(file);
754 struct cx8800_dev *dev = video_drvdata(file); 753 struct cx8800_dev *dev = video_drvdata(file);
755 struct cx88_core *core; 754 struct cx88_core *core;
@@ -773,8 +772,8 @@ static int video_open(struct file *file)
773 772
774 core = dev->core; 773 core = dev->core;
775 774
776 dprintk(1,"open minor=%d radio=%d type=%s\n", 775 dprintk(1, "open dev=%s radio=%d type=%s\n",
777 minor,radio,v4l2_type_names[type]); 776 video_device_node_name(vdev), radio, v4l2_type_names[type]);
778 777
779 /* allocate + initialize per filehandle data */ 778 /* allocate + initialize per filehandle data */
780 fh = kzalloc(sizeof(*fh),GFP_KERNEL); 779 fh = kzalloc(sizeof(*fh),GFP_KERNEL);
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index dd9bbe88c601..0408727b79c6 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -2081,7 +2081,6 @@ static int radio_queryctrl(struct file *file, void *priv,
2081 */ 2081 */
2082static int em28xx_v4l2_open(struct file *filp) 2082static int em28xx_v4l2_open(struct file *filp)
2083{ 2083{
2084 int minor = video_devdata(filp)->minor;
2085 int errCode = 0, radio = 0; 2084 int errCode = 0, radio = 0;
2086 struct video_device *vdev = video_devdata(filp); 2085 struct video_device *vdev = video_devdata(filp);
2087 struct em28xx *dev = video_drvdata(filp); 2086 struct em28xx *dev = video_drvdata(filp);
@@ -2103,8 +2102,9 @@ static int em28xx_v4l2_open(struct file *filp)
2103 2102
2104 mutex_lock(&dev->lock); 2103 mutex_lock(&dev->lock);
2105 2104
2106 em28xx_videodbg("open minor=%d type=%s users=%d\n", 2105 em28xx_videodbg("open dev=%s type=%s users=%d\n",
2107 minor, v4l2_type_names[fh_type], dev->users); 2106 video_device_node_name(vdev), v4l2_type_names[fh_type],
2107 dev->users);
2108 2108
2109 2109
2110 fh = kzalloc(sizeof(struct em28xx_fh), GFP_KERNEL); 2110 fh = kzalloc(sizeof(struct em28xx_fh), GFP_KERNEL);
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c
index e707ef3086b2..babcabd73c08 100644
--- a/drivers/media/video/ivtv/ivtv-fileops.c
+++ b/drivers/media/video/ivtv/ivtv-fileops.c
@@ -985,8 +985,8 @@ int ivtv_v4l2_open(struct file *filp)
985 985
986 mutex_lock(&itv->serialize_lock); 986 mutex_lock(&itv->serialize_lock);
987 if (ivtv_init_on_first_open(itv)) { 987 if (ivtv_init_on_first_open(itv)) {
988 IVTV_ERR("Failed to initialize on minor %d\n", 988 IVTV_ERR("Failed to initialize on device %s\n",
989 vdev->minor); 989 video_device_node_name(vdev));
990 mutex_unlock(&itv->serialize_lock); 990 mutex_unlock(&itv->serialize_lock);
991 return -ENXIO; 991 return -ENXIO;
992 } 992 }
diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c
index b636160fd510..939ae8bf58d5 100644
--- a/drivers/media/video/ov511.c
+++ b/drivers/media/video/ov511.c
@@ -5867,8 +5867,8 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id)
5867 ov511_devused |= 1 << nr; 5867 ov511_devused |= 1 << nr;
5868 ov->nr = nr; 5868 ov->nr = nr;
5869 5869
5870 dev_info(&intf->dev, "Device at %s registered to minor %d\n", 5870 dev_info(&intf->dev, "Device at %s registered to %s\n",
5871 ov->usb_path, ov->vdev->minor); 5871 ov->usb_path, video_device_node_name(ov->vdev));
5872 5872
5873 usb_set_intfdata(intf, ov); 5873 usb_set_intfdata(intf, ov);
5874 if (ov_create_sysfs(ov->vdev)) { 5874 if (ov_create_sysfs(ov->vdev)) {
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index 0a77108ee06f..f6a4929867db 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -1530,7 +1530,6 @@ static int vidioc_s_parm(struct file *file, void *priv,
1530} 1530}
1531static int s2255_open(struct file *file) 1531static int s2255_open(struct file *file)
1532{ 1532{
1533 int minor = video_devdata(file)->minor;
1534 struct video_device *vdev = video_devdata(file); 1533 struct video_device *vdev = video_devdata(file);
1535 struct s2255_dev *dev = video_drvdata(file); 1534 struct s2255_dev *dev = video_drvdata(file);
1536 struct s2255_fh *fh; 1535 struct s2255_fh *fh;
@@ -1538,7 +1537,9 @@ static int s2255_open(struct file *file)
1538 int i = 0; 1537 int i = 0;
1539 int cur_channel = -1; 1538 int cur_channel = -1;
1540 int state; 1539 int state;
1541 dprintk(1, "s2255: open called (minor=%d)\n", minor); 1540
1541 dprintk(1, "s2255: open called (dev=%s)\n",
1542 video_device_node_name(vdev));
1542 1543
1543 lock_kernel(); 1544 lock_kernel();
1544 1545
@@ -1650,8 +1651,9 @@ static int s2255_open(struct file *file)
1650 for (i = 0; i < ARRAY_SIZE(s2255_qctrl); i++) 1651 for (i = 0; i < ARRAY_SIZE(s2255_qctrl); i++)
1651 qctl_regs[i] = s2255_qctrl[i].default_value; 1652 qctl_regs[i] = s2255_qctrl[i].default_value;
1652 1653
1653 dprintk(1, "s2255drv: open minor=%d type=%s users=%d\n", 1654 dprintk(1, "s2255drv: open dev=%s type=%s users=%d\n",
1654 minor, v4l2_type_names[type], dev->users[cur_channel]); 1655 video_device_node_name(vdev), v4l2_type_names[type],
1656 dev->users[cur_channel]);
1655 dprintk(2, "s2255drv: open: fh=0x%08lx, dev=0x%08lx, vidq=0x%08lx\n", 1657 dprintk(2, "s2255drv: open: fh=0x%08lx, dev=0x%08lx, vidq=0x%08lx\n",
1656 (unsigned long)fh, (unsigned long)dev, 1658 (unsigned long)fh, (unsigned long)dev,
1657 (unsigned long)&dev->vidq[cur_channel]); 1659 (unsigned long)&dev->vidq[cur_channel]);
@@ -1728,7 +1730,8 @@ static int s2255_close(struct file *file)
1728{ 1730{
1729 struct s2255_fh *fh = file->private_data; 1731 struct s2255_fh *fh = file->private_data;
1730 struct s2255_dev *dev = fh->dev; 1732 struct s2255_dev *dev = fh->dev;
1731 int minor = video_devdata(file)->minor; 1733 struct video_device *vdev = video_devdata(file);
1734
1732 if (!dev) 1735 if (!dev)
1733 return -ENODEV; 1736 return -ENODEV;
1734 1737
@@ -1748,8 +1751,8 @@ static int s2255_close(struct file *file)
1748 mutex_unlock(&dev->open_lock); 1751 mutex_unlock(&dev->open_lock);
1749 1752
1750 kref_put(&dev->kref, s2255_destroy); 1753 kref_put(&dev->kref, s2255_destroy);
1751 dprintk(1, "s2255: close called (minor=%d, users=%d)\n", 1754 dprintk(1, "s2255: close called (dev=%s, users=%d)\n",
1752 minor, dev->users[fh->channel]); 1755 video_device_node_name(vdev), dev->users[fh->channel]);
1753 kfree(fh); 1756 kfree(fh);
1754 return 0; 1757 return 0;
1755} 1758}
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index 1de27af54590..df56241b30a4 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -86,11 +86,11 @@ static int ts_init_encoder(struct saa7134_dev* dev)
86 86
87static int ts_open(struct file *file) 87static int ts_open(struct file *file)
88{ 88{
89 int minor = video_devdata(file)->minor; 89 struct video_device *vdev = video_devdata(file);
90 struct saa7134_dev *dev = video_drvdata(file); 90 struct saa7134_dev *dev = video_drvdata(file);
91 int err; 91 int err;
92 92
93 dprintk("open minor=%d\n",minor); 93 dprintk("open dev=%s\n", video_device_node_name(vdev));
94 err = -EBUSY; 94 err = -EBUSY;
95 if (!mutex_trylock(&dev->empress_tsq.vb_lock)) 95 if (!mutex_trylock(&dev->empress_tsq.vb_lock))
96 goto done; 96 goto done;
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index bcca5a479817..9d26b1bd732e 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -1326,7 +1326,6 @@ static int saa7134_resource(struct saa7134_fh *fh)
1326 1326
1327static int video_open(struct file *file) 1327static int video_open(struct file *file)
1328{ 1328{
1329 int minor = video_devdata(file)->minor;
1330 struct video_device *vdev = video_devdata(file); 1329 struct video_device *vdev = video_devdata(file);
1331 struct saa7134_dev *dev = video_drvdata(file); 1330 struct saa7134_dev *dev = video_drvdata(file);
1332 struct saa7134_fh *fh; 1331 struct saa7134_fh *fh;
@@ -1345,8 +1344,8 @@ static int video_open(struct file *file)
1345 break; 1344 break;
1346 } 1345 }
1347 1346
1348 dprintk("open minor=%d radio=%d type=%s\n",minor,radio, 1347 dprintk("open dev=%s radio=%d type=%s\n", video_device_node_name(vdev),
1349 v4l2_type_names[type]); 1348 radio, v4l2_type_names[type]);
1350 1349
1351 /* allocate + initialize per filehandle data */ 1350 /* allocate + initialize per filehandle data */
1352 fh = kzalloc(sizeof(*fh),GFP_KERNEL); 1351 fh = kzalloc(sizeof(*fh),GFP_KERNEL);
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 93e0a258080d..ce197e4cc589 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -1222,8 +1222,7 @@ static int vivi_close(struct file *file)
1222 struct vivi_fh *fh = file->private_data; 1222 struct vivi_fh *fh = file->private_data;
1223 struct vivi_dev *dev = fh->dev; 1223 struct vivi_dev *dev = fh->dev;
1224 struct vivi_dmaqueue *vidq = &dev->vidq; 1224 struct vivi_dmaqueue *vidq = &dev->vidq;
1225 1225 struct video_device *vdev = video_devdata(file);
1226 int minor = video_devdata(file)->minor;
1227 1226
1228 vivi_stop_thread(vidq); 1227 vivi_stop_thread(vidq);
1229 videobuf_stop(&fh->vb_vidq); 1228 videobuf_stop(&fh->vb_vidq);
@@ -1235,8 +1234,8 @@ static int vivi_close(struct file *file)
1235 dev->users--; 1234 dev->users--;
1236 mutex_unlock(&dev->mutex); 1235 mutex_unlock(&dev->mutex);
1237 1236
1238 dprintk(dev, 1, "close called (minor=%d, users=%d)\n", 1237 dprintk(dev, 1, "close called (dev=%s, users=%d)\n",
1239 minor, dev->users); 1238 video_device_node_name(vdev), dev->users);
1240 1239
1241 return 0; 1240 return 0;
1242} 1241}