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

Commit c6330fb8 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (9327): v4l: use video_device.num instead of minor in video%d



The kernel number of a v4l2 node (e.g. videoX, radioX or vbiX) is now
independent of the minor number. So instead of using the minor field
of the video_device struct one has to use the num field: this always
contains the kernel number of the device node.

I forgot about this when I did the v4l2 core change, so this patch
converts all drivers that use it in one go. Luckily the change is
trivial.

Cc: michael@mihu.de
Cc: mchehab@infradead.org
Cc: corbet@lwn.net
Cc: luca.risolia@studio.unibo.it
Cc: isely@pobox.com
Cc: pe1rxq@amsat.org
Cc: royale@zerezo.com
Cc: mkrufky@linuxtv.org
Cc: stoth@linuxtv.org
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 323a491a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -545,11 +545,11 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev,
	if( VFL_TYPE_GRABBER == type ) {
		vv->video_minor = vfd->minor;
		INFO(("%s: registered device video%d [v4l2]\n",
			dev->name, vfd->minor & 0x1f));
			dev->name, vfd->num));
	} else {
		vv->vbi_minor = vfd->minor;
		INFO(("%s: registered device vbi%d [v4l2]\n",
			dev->name, vfd->minor & 0x1f));
			dev->name, vfd->num));
	}

	*vid = vfd;
+1 −1
Original line number Diff line number Diff line
@@ -866,7 +866,7 @@ static int __init ar_init(void)
	}

	printk("video%d: Found M64278 VGA (IRQ %d, Freq %dMHz).\n",
		ar->vdev->minor, M32R_IRQ_INT3, freq);
		ar->vdev->num, M32R_IRQ_INT3, freq);

	return 0;

+3 −3
Original line number Diff line number Diff line
@@ -4246,7 +4246,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
				  video_nr[btv->c.nr]) < 0)
		goto err;
	printk(KERN_INFO "bttv%d: registered device video%d\n",
	       btv->c.nr,btv->video_dev->minor & 0x1f);
	       btv->c.nr, btv->video_dev->num);
	if (device_create_file(&btv->video_dev->dev,
				     &dev_attr_card)<0) {
		printk(KERN_ERR "bttv%d: device_create_file 'card' "
@@ -4263,7 +4263,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
				  vbi_nr[btv->c.nr]) < 0)
		goto err;
	printk(KERN_INFO "bttv%d: registered device vbi%d\n",
	       btv->c.nr,btv->vbi_dev->minor & 0x1f);
	       btv->c.nr, btv->vbi_dev->num);

	if (!btv->has_radio)
		return 0;
@@ -4275,7 +4275,7 @@ static int __devinit bttv_register_video(struct bttv *btv)
				  radio_nr[btv->c.nr]) < 0)
		goto err;
	printk(KERN_INFO "bttv%d: registered device radio%d\n",
	       btv->c.nr,btv->radio_dev->minor & 0x1f);
	       btv->c.nr, btv->radio_dev->num);

	/* all done */
	return 0;
+1 −1
Original line number Diff line number Diff line
@@ -815,7 +815,7 @@ static int init_cqcam(struct parport *port)
	}

	printk(KERN_INFO "video%d: Colour QuickCam found on %s\n",
	       qcam->vdev.minor, qcam->pport->name);
	       qcam->vdev.num, qcam->pport->name);

	qcams[num_cams++] = qcam;

+2 −2
Original line number Diff line number Diff line
@@ -2059,10 +2059,10 @@ static void cafe_dfs_cam_setup(struct cafe_camera *cam)

	if (!cafe_dfs_root)
		return;
	sprintf(fname, "regs-%d", cam->v4ldev.minor);
	sprintf(fname, "regs-%d", cam->v4ldev.num);
	cam->dfs_regs = debugfs_create_file(fname, 0444, cafe_dfs_root,
			cam, &cafe_dfs_reg_ops);
	sprintf(fname, "cam-%d", cam->v4ldev.minor);
	sprintf(fname, "cam-%d", cam->v4ldev.num);
	cam->dfs_cam_regs = debugfs_create_file(fname, 0444, cafe_dfs_root,
			cam, &cafe_dfs_cam_ops);
}
Loading