diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-21 15:09:45 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-21 15:09:45 -0300 |
commit | 0b8face2f09a06c0608472c22fe5a704b6dc4c0e (patch) | |
tree | 39d774e364a86e831312c1568cd8438afcd773c8 /linux/drivers/media/video/uvc/uvc_status.c | |
parent | 04ef26ec109fff2b6d310da4dabdafc4135ad058 (diff) | |
parent | 85a3fd2b44d6162a4288a264537c287adf79b4f9 (diff) | |
download | mediapointer-dvb-s2-0b8face2f09a06c0608472c22fe5a704b6dc4c0e.tar.gz mediapointer-dvb-s2-0b8face2f09a06c0608472c22fe5a704b6dc4c0e.tar.bz2 |
merge: http://kernellabs.com/hg/~mkrufky/bug-fix
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/uvc/uvc_status.c')
-rw-r--r-- | linux/drivers/media/video/uvc/uvc_status.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/linux/drivers/media/video/uvc/uvc_status.c b/linux/drivers/media/video/uvc/uvc_status.c index 1e1bda413..b05df63b4 100644 --- a/linux/drivers/media/video/uvc/uvc_status.c +++ b/linux/drivers/media/video/uvc/uvc_status.c @@ -206,7 +206,7 @@ int uvc_status_init(struct uvc_device *dev) dev->status, UVC_MAX_STATUS_SIZE, uvc_status_complete, dev, interval); - return usb_submit_urb(dev->int_urb, GFP_KERNEL); + return 0; } void uvc_status_cleanup(struct uvc_device *dev) @@ -217,15 +217,30 @@ void uvc_status_cleanup(struct uvc_device *dev) uvc_input_cleanup(dev); } -int uvc_status_suspend(struct uvc_device *dev) +int uvc_status_start(struct uvc_device *dev) +{ + if (dev->int_urb == NULL) + return 0; + + return usb_submit_urb(dev->int_urb, GFP_KERNEL); +} + +void uvc_status_stop(struct uvc_device *dev) { usb_kill_urb(dev->int_urb); +} + +int uvc_status_suspend(struct uvc_device *dev) +{ + if (atomic_read(&dev->users)) + usb_kill_urb(dev->int_urb); + return 0; } int uvc_status_resume(struct uvc_device *dev) { - if (dev->int_urb == NULL) + if (dev->int_urb == NULL || atomic_read(&dev->users) == 0) return 0; return usb_submit_urb(dev->int_urb, GFP_NOIO); |