Skip to content

Commit

Permalink
V4L/DVB (13555a): v4l: Use video_device_node_name() instead of the mi…
Browse files Browse the repository at this point in the history
…nor 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 <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mauro Carvalho Chehab committed May 18, 2010
1 parent 1eefd76 commit 0a34df5
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions drivers/staging/tm6000/tm6000-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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--;

Expand Down

0 comments on commit 0a34df5

Please sign in to comment.