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

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

[media] saa7164: add v4l2_device and replace parent with v4l2_dev



This driver did not yet support struct v4l2_device, so add it. This
make it possible to replace the deprecated parent field with the
v4l2_dev field, allowing the eventual removal of the parent field.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f1741fa8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1196,6 +1196,11 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
	if (NULL == dev)
		return -ENOMEM;

	if (v4l2_device_register(&pci_dev->dev, &dev->v4l2_dev)) {
		dev_err(&pci_dev->dev, "v4l2_device_register failed\n");
		goto fail_free;
	}

	/* pci init */
	dev->pci = pci_dev;
	if (pci_enable_device(pci_dev)) {
@@ -1367,6 +1372,7 @@ fail_fw:
fail_irq:
	saa7164_dev_unregister(dev);
fail_free:
	v4l2_device_unregister(&dev->v4l2_dev);
	kfree(dev);
	return err;
}
@@ -1439,6 +1445,7 @@ static void saa7164_finidev(struct pci_dev *pci_dev)
	mutex_unlock(&devlist);

	saa7164_dev_unregister(dev);
	v4l2_device_unregister(&dev->v4l2_dev);
	kfree(dev);
}

+1 −1
Original line number Diff line number Diff line
@@ -1348,7 +1348,7 @@ static struct video_device *saa7164_encoder_alloc(
	snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", dev->name,
		type, saa7164_boards[dev->board].name);

	vfd->parent  = &pci->dev;
	vfd->v4l2_dev  = &dev->v4l2_dev;
	vfd->release = video_device_release;
	return vfd;
}
+1 −1
Original line number Diff line number Diff line
@@ -1297,7 +1297,7 @@ static struct video_device *saa7164_vbi_alloc(
	snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", dev->name,
		type, saa7164_boards[dev->board].name);

	vfd->parent  = &pci->dev;
	vfd->v4l2_dev  = &dev->v4l2_dev;
	vfd->release = video_device_release;
	return vfd;
}
+3 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@
#include <dmxdev.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-device.h>

#include "saa7164-reg.h"
#include "saa7164-types.h"
@@ -427,6 +428,8 @@ struct saa7164_dev {
	struct list_head	devlist;
	atomic_t		refcount;

	struct v4l2_device v4l2_dev;

	/* pci stuff */
	struct pci_dev	*pci;
	unsigned char	pci_rev, pci_lat;