Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219114
b: refs/heads/master
c: 7074f40
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Oct 21, 2010
1 parent 2d75c63 commit 7c11a75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 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: 479567ce3af7b99d645a3c53b8ca2fc65e46efdc
refs/heads/master: 7074f407198c79498795bb0fd04c2df36ab97a19
12 changes: 5 additions & 7 deletions trunk/drivers/media/video/pwc/pwc-if.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static const struct v4l2_file_operations pwc_fops = {
.read = pwc_video_read,
.poll = pwc_video_poll,
.mmap = pwc_video_mmap,
.ioctl = pwc_video_ioctl,
.unlocked_ioctl = pwc_video_ioctl,
};
static struct video_device pwc_template = {
.name = "Philips Webcam", /* Filled in later */
Expand Down Expand Up @@ -1247,8 +1247,8 @@ static int pwc_video_close(struct file *file)

PWC_DEBUG_OPEN(">> video_close called(vdev = 0x%p).\n", vdev);

lock_kernel();
pdev = video_get_drvdata(vdev);
mutex_lock(&pdev->modlock);
if (pdev->vopen == 0)
PWC_DEBUG_MODULE("video_close() called on closed device?\n");

Expand Down Expand Up @@ -1286,7 +1286,7 @@ static int pwc_video_close(struct file *file)
if (device_hint[hint].pdev == pdev)
device_hint[hint].pdev = NULL;
}
unlock_kernel();
mutex_unlock(&pdev->modlock);

return 0;
}
Expand Down Expand Up @@ -1872,8 +1872,8 @@ static void usb_pwc_disconnect(struct usb_interface *intf)
struct pwc_device *pdev;
int hint;

lock_kernel();
pdev = usb_get_intfdata (intf);
mutex_lock(&pdev->modlock);
usb_set_intfdata (intf, NULL);
if (pdev == NULL) {
PWC_ERROR("pwc_disconnect() Called without private pointer.\n");
Expand All @@ -1898,9 +1898,7 @@ static void usb_pwc_disconnect(struct usb_interface *intf)
wake_up_interruptible(&pdev->frameq);
/* Wait until device is closed */
if (pdev->vopen) {
mutex_lock(&pdev->modlock);
pdev->unplugged = 1;
mutex_unlock(&pdev->modlock);
pwc_iso_stop(pdev);
} else {
/* Device is closed, so we can safely unregister it */
Expand All @@ -1914,7 +1912,7 @@ static void usb_pwc_disconnect(struct usb_interface *intf)
device_hint[hint].pdev = NULL;
}

unlock_kernel();
mutex_unlock(&pdev->modlock);
}


Expand Down

0 comments on commit 7c11a75

Please sign in to comment.