Thread (2 messages) 2 messages, 2 authors, 2009-11-25

How to learn a device is open

From: Oliver Neukum <oliver@neukum.org>
Date: 2009-11-25 16:57:12

Hi,

I need a way to determine whether an input device has been opened.
A private flag seems wasteful. Is this an acceptable method?

	Regards
		Oliver

+static int usbtouch_resume(struct usb_interface *intf)
+{
+       struct usbtouch_usb *usbtouch = usb_get_intfdata(intf);
+       struct input_dev *input = usbtouch->input;
+       int result = 0;
+
+       mutex_lock(&input->mutex);
+       if (input->users)
+               result = usb_submit_urb(usbtouch->irq, GFP_NOIO);
+       mutex_unlock(&input->mutex);
+       return result;
+}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help