Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137714
b: refs/heads/master
c: b960074
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 402fe4f commit 05e7f5e
Show file tree
Hide file tree
Showing 9 changed files with 1,405 additions and 1,511 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: c9b8b04b267f9a7e472daa06cdf6d4963d503d1f
refs/heads/master: b960074fec573fb1b226d9e2686ce51be807cdf1
36 changes: 14 additions & 22 deletions trunk/drivers/media/common/saa7146_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,6 @@ static int fops_release(struct file *file)
return 0;
}

static long fops_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
/*
DEB_EE(("file:%p, cmd:%d, arg:%li\n", file, cmd, arg));
*/
return video_usercopy(file, cmd, arg, saa7146_video_do_ioctl);
}

static int fops_mmap(struct file *file, struct vm_area_struct * vma)
{
struct saa7146_fh *fh = file->private_data;
Expand Down Expand Up @@ -425,7 +417,7 @@ static const struct v4l2_file_operations video_fops =
.write = fops_write,
.poll = fops_poll,
.mmap = fops_mmap,
.ioctl = fops_ioctl,
.ioctl = video_ioctl2,
};

static void vv_callback(struct saa7146_dev *dev, unsigned long status)
Expand All @@ -452,19 +444,16 @@ static void vv_callback(struct saa7146_dev *dev, unsigned long status)
}
}

static struct video_device device_template =
{
.fops = &video_fops,
.minor = -1,
};

int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv)
{
struct saa7146_vv *vv = kzalloc (sizeof(struct saa7146_vv),GFP_KERNEL);
if( NULL == vv ) {
struct saa7146_vv *vv = kzalloc(sizeof(struct saa7146_vv), GFP_KERNEL);

if (vv == NULL) {
ERR(("out of memory. aborting.\n"));
return -1;
}
ext_vv->ops = saa7146_video_ioctl_ops;
ext_vv->core_ops = &saa7146_video_ioctl_ops;

DEB_EE(("dev:%p\n",dev));

Expand Down Expand Up @@ -521,6 +510,7 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev,
{
struct saa7146_vv *vv = dev->vv_data;
struct video_device *vfd;
int err;

DEB_EE(("dev:%p, name:'%s', type:%d\n",dev,name,type));

Expand All @@ -529,16 +519,18 @@ int saa7146_register_device(struct video_device **vid, struct saa7146_dev* dev,
if (vfd == NULL)
return -ENOMEM;

memcpy(vfd, &device_template, sizeof(struct video_device));
strlcpy(vfd->name, name, sizeof(vfd->name));
vfd->fops = &video_fops;
vfd->ioctl_ops = dev->ext_vv_data ? &dev->ext_vv_data->ops :
&saa7146_video_ioctl_ops;
vfd->release = video_device_release;
strlcpy(vfd->name, name, sizeof(vfd->name));
video_set_drvdata(vfd, dev);

// fixme: -1 should be an insmod parameter *for the extension* (like "video_nr");
if (video_register_device(vfd, type, -1) < 0) {
err = video_register_device(vfd, type, -1);
if (err < 0) {
ERR(("cannot register v4l2 device. skipping.\n"));
video_device_release(vfd);
return -1;
return err;
}

if( VFL_TYPE_GRABBER == type ) {
Expand Down
Loading

0 comments on commit 05e7f5e

Please sign in to comment.