aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/uvc/uvc_status.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-21 15:06:09 +0200
committerIngo Molnar <mingo@elte.hu>2008-07-21 15:06:09 +0200
commite66d90fb4abd0a27ee96f57a32fb561221c4d6ae (patch)
tree3337cba94c7444b06fdb0e8b487287d07b71f4a0 /drivers/media/video/uvc/uvc_status.c
parent55ca089e2579de90f048aca2a3030b8b2f864813 (diff)
parent14b395e35d1afdd8019d11b92e28041fad591b71 (diff)
Merge branch 'linus' into xen-64bit
Diffstat (limited to 'drivers/media/video/uvc/uvc_status.c')
-rw-r--r--drivers/media/video/uvc/uvc_status.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/media/video/uvc/uvc_status.c b/drivers/media/video/uvc/uvc_status.c
index be9084e5eac..75e678ac54e 100644
--- a/drivers/media/video/uvc/uvc_status.c
+++ b/drivers/media/video/uvc/uvc_status.c
@@ -22,6 +22,7 @@
/* --------------------------------------------------------------------------
* Input device
*/
+#ifdef CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV
static int uvc_input_init(struct uvc_device *dev)
{
struct usb_device *udev = dev->udev;
@@ -67,6 +68,19 @@ static void uvc_input_cleanup(struct uvc_device *dev)
input_unregister_device(dev->input);
}
+static void uvc_input_report_key(struct uvc_device *dev, unsigned int code,
+ int value)
+{
+ if (dev->input)
+ input_report_key(dev->input, code, value);
+}
+
+#else
+#define uvc_input_init(dev)
+#define uvc_input_cleanup(dev)
+#define uvc_input_report_key(dev, code, value)
+#endif /* CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV */
+
/* --------------------------------------------------------------------------
* Status interrupt endpoint
*/
@@ -83,8 +97,7 @@ static void uvc_event_streaming(struct uvc_device *dev, __u8 *data, int len)
return;
uvc_trace(UVC_TRACE_STATUS, "Button (intf %u) %s len %d\n",
data[1], data[3] ? "pressed" : "released", len);
- if (dev->input)
- input_report_key(dev->input, BTN_0, data[3]);
+ uvc_input_report_key(dev, BTN_0, data[3]);
} else {
uvc_trace(UVC_TRACE_STATUS, "Stream %u error event %02x %02x "
"len %d.\n", data[1], data[2], data[3], len);
@@ -203,5 +216,6 @@ int uvc_status_resume(struct uvc_device *dev)
if (dev->int_urb == NULL)
return 0;
- return usb_submit_urb(dev->int_urb, GFP_KERNEL);
+ return usb_submit_urb(dev->int_urb, GFP_NOIO);
}
+