From 0a34df5359ea153bf6f756c0c9db2ca2bc002cf4 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 18 May 2010 00:43:18 -0300 Subject: [PATCH] V4L/DVB (13555a): 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: apply just the tm6000 changes on a separate patch] Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/tm6000/tm6000-video.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/staging/tm6000/tm6000-video.c b/drivers/staging/tm6000/tm6000-video.c index fc5a9089ab68..d853f82f443d 100644 --- a/drivers/staging/tm6000/tm6000-video.c +++ b/drivers/staging/tm6000/tm6000-video.c @@ -1311,18 +1311,18 @@ static int vidioc_s_frequency (struct file *file, void *priv, static int tm6000_open(struct file *file) { - int minor = video_devdata(file)->minor; - struct tm6000_core *h,*dev = NULL; + struct video_device *vdev = video_devdata(file); + struct tm6000_core *dev = video_drvdata(file); struct tm6000_fh *fh; struct list_head *list; enum v4l2_buf_type type = 0; int i,rc; - printk(KERN_INFO "tm6000: open called (minor=%d)\n",minor); + printk(KERN_INFO "tm6000: open called (dev=%s)\n", + video_device_node_name(vdev)); - - dprintk(dev, V4L2_DEBUG_OPEN, "tm6000: open called " - "(minor=%d)\n",minor); + dprintk(dev, V4L2_DEBUG_OPEN, "tm6000: open called (dev=%s)\n", + video_device_node_name(vdev)); list_for_each(list,&tm6000_corelist) { h = list_entry(list, struct tm6000_core, tm6000_corelist); @@ -1338,8 +1338,9 @@ static int tm6000_open(struct file *file) /* If more than one user, mutex should be added */ dev->users++; - dprintk(dev, V4L2_DEBUG_OPEN, "open minor=%d type=%s users=%d\n", - minor,v4l2_type_names[type],dev->users); + dprintk(dev, V4L2_DEBUG_OPEN, "open dev=%s type=%s users=%d\n", + video_device_node_name(vdev), v4l2_type_names[type], + dev->users); /* allocate + initialize per filehandle data */ fh = kzalloc(sizeof(*fh),GFP_KERNEL); @@ -1436,9 +1437,10 @@ static int tm6000_release(struct file *file) { struct tm6000_fh *fh = file->private_data; struct tm6000_core *dev = fh->dev; - int minor = video_devdata(file)->minor; + struct video_device *vdev = video_devdata(file); - dprintk(dev, V4L2_DEBUG_OPEN, "tm6000: close called (minor=%d, users=%d)\n",minor,dev->users); + dprintk(dev, V4L2_DEBUG_OPEN, "tm6000: close called (dev=%s, users=%d)\n", + video_device_node_name(vdev), dev->users); dev->users--; -- 2.20.1