summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx88/cx88-core.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-03-09 13:34:00 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-04-08 06:43:16 -0300
commit34080bc25fa04e07691e853cd516c431b67be5f4 (patch)
tree78116e7d353c87097cd63ec9bcd4259120588bc3 /drivers/media/pci/cx88/cx88-core.c
parent55cda4ab5386418b31e626e91bbf4eedf209b9bb (diff)
downloadlinux-stable-34080bc25fa04e07691e853cd516c431b67be5f4.tar.gz
linux-stable-34080bc25fa04e07691e853cd516c431b67be5f4.tar.bz2
linux-stable-34080bc25fa04e07691e853cd516c431b67be5f4.zip
[media] cx88: embed video_device
Embed the video_device struct to simplify the error handling and in order to (eventually) get rid of video_device_alloc/release. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci/cx88/cx88-core.c')
-rw-r--r--drivers/media/pci/cx88/cx88-core.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/media/pci/cx88/cx88-core.c b/drivers/media/pci/cx88/cx88-core.c
index c38d5a12e277..3501be9f19d8 100644
--- a/drivers/media/pci/cx88/cx88-core.c
+++ b/drivers/media/pci/cx88/cx88-core.c
@@ -985,17 +985,14 @@ int cx88_set_tvnorm(struct cx88_core *core, v4l2_std_id norm)
/* ------------------------------------------------------------------ */
-struct video_device *cx88_vdev_init(struct cx88_core *core,
- struct pci_dev *pci,
- const struct video_device *template_,
- const char *type)
+void cx88_vdev_init(struct cx88_core *core,
+ struct pci_dev *pci,
+ struct video_device *vfd,
+ const struct video_device *template_,
+ const char *type)
{
- struct video_device *vfd;
-
- vfd = video_device_alloc();
- if (NULL == vfd)
- return NULL;
*vfd = *template_;
+
/*
* The dev pointer of v4l2_device is NULL, instead we set the
* video_device dev_parent pointer to the correct PCI bus device.
@@ -1004,11 +1001,10 @@ struct video_device *cx88_vdev_init(struct cx88_core *core,
*/
vfd->v4l2_dev = &core->v4l2_dev;
vfd->dev_parent = &pci->dev;
- vfd->release = video_device_release;
+ vfd->release = video_device_release_empty;
vfd->lock = &core->lock;
snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)",
core->name, type, core->board.name);
- return vfd;
}
struct cx88_core* cx88_core_get(struct pci_dev *pci)