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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Родитель
1eefd763fb
Коммит
0a34df5359
|
@ -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--;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче