Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232229
b: refs/heads/master
c: 3c61be4
h: refs/heads/master
i:
  232227: 2bcc752
v: v3
  • Loading branch information
Dmitri Belimov authored and Mauro Carvalho Chehab committed Jan 19, 2011
1 parent 154aa9c commit 17dfd84
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2400982a2e8a8e4e95f0a0e1517bbe63cc88038f
refs/heads/master: 3c61be446ae5c26e2829d37c6b5d02d3af536024
46 changes: 36 additions & 10 deletions trunk/drivers/staging/tm6000/tm6000-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,29 +1450,55 @@ static struct video_device tm6000_template = {
* ------------------------------------------------------------------
*/

int tm6000_v4l2_register(struct tm6000_core *dev)
static struct video_device *vdev_init(struct tm6000_core *dev,
const struct video_device
*template, const char *type_name)
{
int ret = -1;
struct video_device *vfd;

vfd = video_device_alloc();
if(!vfd) {
if (NULL == vfd)
return NULL;

*vfd = *template;
vfd->v4l2_dev = &dev->v4l2_dev;
vfd->release = video_device_release;
vfd->debug = tm6000_debug;
vfd->lock = &dev->lock;

snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name);

video_set_drvdata(vfd, dev);
return vfd;
}

int tm6000_v4l2_register(struct tm6000_core *dev)
{
int ret = -1;

dev->vfd = vdev_init(dev, &tm6000_template, "video");

if (!dev->vfd) {
printk(KERN_INFO "%s: can't register video device\n",
dev->name);
return -ENOMEM;
}
dev->vfd = vfd;

/* init video dma queues */
INIT_LIST_HEAD(&dev->vidq.active);
INIT_LIST_HEAD(&dev->vidq.queued);

memcpy(dev->vfd, &tm6000_template, sizeof(*(dev->vfd)));
dev->vfd->debug = tm6000_debug;
dev->vfd->lock = &dev->lock;
ret = video_register_device(dev->vfd, VFL_TYPE_GRABBER, video_nr);

vfd->v4l2_dev = &dev->v4l2_dev;
video_set_drvdata(vfd, dev);
if (ret < 0) {
printk(KERN_INFO "%s: can't register video device\n",
dev->name);
return ret;
}

printk(KERN_INFO "%s: registered device %s\n",
dev->name, video_device_node_name(dev->vfd));

ret = video_register_device(dev->vfd, VFL_TYPE_GRABBER, video_nr);
printk(KERN_INFO "Trident TVMaster TM5600/TM6000/TM6010 USB2 board (Load status: %d)\n", ret);
return ret;
}
Expand Down

0 comments on commit 17dfd84

Please sign in to comment.