Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50462eb0 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 63b0d5ad
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -194,7 +194,6 @@ void saa7146_buffer_timeout(unsigned long data)

static int fops_open(struct file *file)
{
	unsigned int minor = video_devdata(file)->minor;
	struct video_device *vdev = video_devdata(file);
	struct saa7146_dev *dev = video_drvdata(file);
	struct saa7146_fh *fh = NULL;
@@ -202,7 +201,7 @@ static int fops_open(struct file *file)

	enum v4l2_buf_type type;

	DEB_EE(("file:%p, minor:%d\n", file, minor));
	DEB_EE(("file:%p, dev:%s\n", file, video_device_node_name(vdev)));

	if (mutex_lock_interruptible(&saa7146_devices_lock))
		return -ERESTARTSYS;
+4 −2
Original line number Diff line number Diff line
@@ -3207,11 +3207,12 @@ static unsigned int bttv_poll(struct file *file, poll_table *wait)
static int bttv_open(struct file *file)
{
	int minor = video_devdata(file)->minor;
	struct video_device *vdev = video_devdata(file);
	struct bttv *btv = video_drvdata(file);
	struct bttv_fh *fh;
	enum v4l2_buf_type type = 0;

	dprintk(KERN_DEBUG "bttv: open minor=%d\n",minor);
	dprintk(KERN_DEBUG "bttv: open dev=%s\n", video_device_node_name(vdev));

	lock_kernel();
	if (btv->video_dev->minor == minor) {
@@ -3409,10 +3410,11 @@ static struct video_device bttv_video_template = {
static int radio_open(struct file *file)
{
	int minor = video_devdata(file)->minor;
	struct video_device *vdev = video_devdata(file);
	struct bttv *btv = video_drvdata(file);
	struct bttv_fh *fh;

	dprintk("bttv: open minor=%d\n",minor);
	dprintk("bttv: open dev=%s\n", video_device_node_name(vdev));

	lock_kernel();
	WARN_ON(btv->radio_dev && btv->radio_dev->minor != minor);
+2 −2
Original line number Diff line number Diff line
@@ -758,8 +758,8 @@ int cx18_v4l2_open(struct file *filp)

	mutex_lock(&cx->serialize_lock);
	if (cx18_init_on_first_open(cx)) {
		CX18_ERR("Failed to initialize on minor %d\n",
			 video_dev->minor);
		CX18_ERR("Failed to initialize on %s\n",
			 video_device_node_name(video_dev));
		mutex_unlock(&cx->serialize_lock);
		return -ENXIO;
	}
+3 −3
Original line number Diff line number Diff line
@@ -1916,7 +1916,6 @@ static int radio_queryctrl(struct file *file, void *priv,
 */
static int cx231xx_v4l2_open(struct file *filp)
{
	int minor = video_devdata(filp)->minor;
	int errCode = 0, radio = 0;
	struct video_device *vdev = video_devdata(filp);
	struct cx231xx *dev = video_drvdata(filp);
@@ -1937,8 +1936,9 @@ static int cx231xx_v4l2_open(struct file *filp)

	mutex_lock(&dev->lock);

	cx231xx_videodbg("open minor=%d type=%s users=%d\n",
			 minor, v4l2_type_names[fh_type], dev->users);
	cx231xx_videodbg("open dev=%s type=%s users=%d\n",
			 video_device_node_name(vdev), v4l2_type_names[fh_type],
			 dev->users);

#if 0
	errCode = cx231xx_set_mode(dev, CX231XX_ANALOG_MODE);
+2 −3
Original line number Diff line number Diff line
@@ -717,7 +717,6 @@ static int get_resource(struct cx23885_fh *fh)

static int video_open(struct file *file)
{
	int minor = video_devdata(file)->minor;
	struct video_device *vdev = video_devdata(file);
	struct cx23885_dev *dev = video_drvdata(file);
	struct cx23885_fh *fh;
@@ -736,8 +735,8 @@ static int video_open(struct file *file)
		break;
	}

	dprintk(1, "open minor=%d radio=%d type=%s\n",
		minor, radio, v4l2_type_names[type]);
	dprintk(1, "open dev=%s radio=%d type=%s\n",
		video_device_node_name(vdev), radio, v4l2_type_names[type]);

	/* allocate + initialize per filehandle data */
	fh = kzalloc(sizeof(*fh), GFP_KERNEL);
Loading