Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113991
b: refs/heads/master
c: a31a405
h: refs/heads/master
i:
  113989: 851f68f
  113987: 3e731a7
  113983: 2b01c23
v: v3
  • Loading branch information
Ming Lei authored and Mauro Carvalho Chehab committed Oct 12, 2008
1 parent 80da040 commit c1ecc84
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 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: d63beb9ef004ff9587b3c466361276254d57d7a7
refs/heads/master: a31a4055473bf0a7b2b06cb2262347200d0711e1
11 changes: 9 additions & 2 deletions trunk/drivers/media/video/uvc/uvc_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,15 @@ int uvc_status_init(struct uvc_device *dev)

uvc_input_init(dev);

dev->status = kzalloc(UVC_MAX_STATUS_SIZE, GFP_KERNEL);
if (dev->status == NULL)
return -ENOMEM;

dev->int_urb = usb_alloc_urb(0, GFP_KERNEL);
if (dev->int_urb == NULL)
if (dev->int_urb == NULL) {
kfree(dev->status);
return -ENOMEM;
}

pipe = usb_rcvintpipe(dev->udev, ep->desc.bEndpointAddress);

Expand All @@ -192,7 +198,7 @@ int uvc_status_init(struct uvc_device *dev)
interval = fls(interval) - 1;

usb_fill_int_urb(dev->int_urb, dev->udev, pipe,
dev->status, sizeof dev->status, uvc_status_complete,
dev->status, UVC_MAX_STATUS_SIZE, uvc_status_complete,
dev, interval);

return usb_submit_urb(dev->int_urb, GFP_KERNEL);
Expand All @@ -202,6 +208,7 @@ void uvc_status_cleanup(struct uvc_device *dev)
{
usb_kill_urb(dev->int_urb);
usb_free_urb(dev->int_urb);
kfree(dev->status);
uvc_input_cleanup(dev);
}

Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/media/video/uvc/uvcvideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ struct uvc_xu_control {
#define UVC_MAX_FRAME_SIZE (16*1024*1024)
/* Maximum number of video buffers. */
#define UVC_MAX_VIDEO_BUFFERS 32
/* Maximum status buffer size in bytes of interrupt URB. */
#define UVC_MAX_STATUS_SIZE 16

#define UVC_CTRL_CONTROL_TIMEOUT 300
#define UVC_CTRL_STREAMING_TIMEOUT 1000
Expand Down Expand Up @@ -634,7 +636,7 @@ struct uvc_device {
/* Status Interrupt Endpoint */
struct usb_host_endpoint *int_ep;
struct urb *int_urb;
__u8 status[16];
__u8 *status;
struct input_dev *input;

/* Video Streaming interfaces */
Expand Down

0 comments on commit c1ecc84

Please sign in to comment.