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

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

V4L/DVB (13553): v4l: Use the video_is_registered function in device drivers



Fix all device drivers to use the video_is_registered function instead
of checking video_device::minor.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 957b4aa9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -4208,21 +4208,21 @@ static struct video_device *vdev_init(struct bttv *btv,
static void bttv_unregister_video(struct bttv *btv)
{
	if (btv->video_dev) {
		if (-1 != btv->video_dev->minor)
		if (video_is_registered(btv->video_dev))
			video_unregister_device(btv->video_dev);
		else
			video_device_release(btv->video_dev);
		btv->video_dev = NULL;
	}
	if (btv->vbi_dev) {
		if (-1 != btv->vbi_dev->minor)
		if (video_is_registered(btv->vbi_dev))
			video_unregister_device(btv->vbi_dev);
		else
			video_device_release(btv->vbi_dev);
		btv->vbi_dev = NULL;
	}
	if (btv->radio_dev) {
		if (-1 != btv->radio_dev->minor)
		if (video_is_registered(btv->radio_dev))
			video_unregister_device(btv->radio_dev);
		else
			video_device_release(btv->radio_dev);
+3 −3
Original line number Diff line number Diff line
@@ -2020,7 +2020,7 @@ void cx231xx_release_analog_resources(struct cx231xx *dev)
	/*FIXME: I2C IR should be disconnected */

	if (dev->radio_dev) {
		if (-1 != dev->radio_dev->minor)
		if (video_is_registered(dev->radio_dev))
			video_unregister_device(dev->radio_dev);
		else
			video_device_release(dev->radio_dev);
@@ -2029,7 +2029,7 @@ void cx231xx_release_analog_resources(struct cx231xx *dev)
	if (dev->vbi_dev) {
		cx231xx_info("V4L2 device %s deregistered\n",
			     video_device_node_name(dev->vbi_dev));
		if (-1 != dev->vbi_dev->minor)
		if (video_is_registered(dev->vbi_dev))
			video_unregister_device(dev->vbi_dev);
		else
			video_device_release(dev->vbi_dev);
@@ -2038,7 +2038,7 @@ void cx231xx_release_analog_resources(struct cx231xx *dev)
	if (dev->vdev) {
		cx231xx_info("V4L2 device %s deregistered\n",
			     video_device_node_name(dev->vdev));
		if (-1 != dev->vdev->minor)
		if (video_is_registered(dev->vdev))
			video_unregister_device(dev->vdev);
		else
			video_device_release(dev->vdev);
+1 −1
Original line number Diff line number Diff line
@@ -1746,7 +1746,7 @@ void cx23885_417_unregister(struct cx23885_dev *dev)
	dprintk(1, "%s()\n", __func__);

	if (dev->v4l_device) {
		if (-1 != dev->v4l_device->minor)
		if (video_is_registered(dev->v4l_device))
			video_unregister_device(dev->v4l_device);
		else
			video_device_release(dev->v4l_device);
+1 −1
Original line number Diff line number Diff line
@@ -1461,7 +1461,7 @@ void cx23885_video_unregister(struct cx23885_dev *dev)
	cx_clear(PCI_INT_MSK, 1);

	if (dev->video_dev) {
		if (-1 != dev->video_dev->minor)
		if (video_is_registered(dev->video_dev))
			video_unregister_device(dev->video_dev);
		else
			video_device_release(dev->video_dev);
+1 −1
Original line number Diff line number Diff line
@@ -1276,7 +1276,7 @@ static int cx8802_blackbird_advise_release(struct cx8802_driver *drv)
static void blackbird_unregister_video(struct cx8802_dev *dev)
{
	if (dev->mpeg_dev) {
		if (-1 != dev->mpeg_dev->minor)
		if (video_is_registered(dev->mpeg_dev))
			video_unregister_device(dev->mpeg_dev);
		else
			video_device_release(dev->mpeg_dev);
Loading