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

[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
......@@ -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 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
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);
}
......
......@@ -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;
}
......
......@@ -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;
}
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment