linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to learn a device is open
@ 2009-11-25 16:57 Oliver Neukum
  2009-11-25 20:15 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Neukum @ 2009-11-25 16:57 UTC (permalink / raw)
  To: Dmitry Torokhov, linux-input, Jiri Kosina

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;
+}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-25 20:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25 16:57 How to learn a device is open Oliver Neukum
2009-11-25 20:15 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).