Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306431
b: refs/heads/master
c: 217d55f
h: refs/heads/master
i:
  306429: f99839a
  306427: 2ea6bd1
  306423: 1bb03bd
  306415: c33f3f8
  306399: 1f415d4
  306367: 6143910
  306303: dc42619
  306175: d01b6ff
v: v3
  • Loading branch information
Ezequiel García authored and Mauro Carvalho Chehab committed May 15, 2012
1 parent 512527a commit 525562f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 26 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: 751869e6ef489e33c66a254fa004c92e76ef1a43
refs/heads/master: 217d55f2ba0511a18f7427c4a0c10ea21c2eb7d0
58 changes: 33 additions & 25 deletions trunk/drivers/staging/media/easycap/easycap_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3291,6 +3291,37 @@ static const struct v4l2_file_operations v4l2_fops = {
.mmap = easycap_mmap,
};

static int easycap_register_video(struct easycap *peasycap)
{
/*
* FIXME: This is believed to be harmless,
* but may well be unnecessary or wrong.
*/
peasycap->video_device.v4l2_dev = NULL;

strcpy(&peasycap->video_device.name[0], "easycapdc60");
peasycap->video_device.fops = &v4l2_fops;
peasycap->video_device.minor = -1;
peasycap->video_device.release = (void *)(&videodev_release);

video_set_drvdata(&(peasycap->video_device), (void *)peasycap);

if (0 != (video_register_device(&(peasycap->video_device),
VFL_TYPE_GRABBER, -1))) {
err("Not able to register with videodev");
videodev_release(&(peasycap->video_device));
return -ENODEV;
}

peasycap->registered_video++;

SAM("registered with videodev: %i=minor\n",
peasycap->video_device.minor);
peasycap->minor = peasycap->video_device.minor;

return 0;
}

/*
* When the device is plugged, this function is called three times,
* one for each interface.
Expand Down Expand Up @@ -3667,32 +3698,9 @@ static int easycap_usb_probe(struct usb_interface *intf,
JOM(4, "registered device instance: %s\n",
peasycap->v4l2_device.name);

/*
* FIXME: This is believed to be harmless,
* but may well be unnecessary or wrong.
*/
peasycap->video_device.v4l2_dev = NULL;


strcpy(&peasycap->video_device.name[0], "easycapdc60");
peasycap->video_device.fops = &v4l2_fops;
peasycap->video_device.minor = -1;
peasycap->video_device.release = (void *)(&videodev_release);

video_set_drvdata(&(peasycap->video_device), (void *)peasycap);

if (0 != (video_register_device(&(peasycap->video_device),
VFL_TYPE_GRABBER, -1))) {
err("Not able to register with videodev");
videodev_release(&(peasycap->video_device));
rc = easycap_register_video(peasycap);
if (rc < 0)
return -ENODEV;
}

peasycap->registered_video++;
SAM("registered with videodev: %i=minor\n",
peasycap->video_device.minor);
peasycap->minor = peasycap->video_device.minor;

break;
}
/* 1: Audio control */
Expand Down

0 comments on commit 525562f

Please sign in to comment.