How to learn a device is open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
+}
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux