mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-02-02 17:16:45 +00:00
[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: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
f1741fa8dd
commit
d66de790c7
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user