On Thu, 12 Oct 2006, Oliver Neukum wrote: > Am Donnerstag, 12. Oktober 2006 19:10 schrieb Alan Stern: > > > void hid_close(struct hid_device *hid) > > > { > > > - if (!--hid->open) > > > + if (!--hid->open) { > > > usb_kill_urb(hid->urbin); > > > + set_bit(HID_IN_IDLE, &hid->iofl); > > > + } > > > } > > > > There needs to be a call to usb_autopm_put_interface() here, to balance > > the call in hid_open(). > > OK, of course. Please disregard my last remark.
In fact the usb_autpm_{get|put}_interface API is a little clumsy. It works okay if you do nothing but suspend on close and resume on open. But for anything more substantial it tends to get in the way. If you have any ideas for a better approach, let me know. In the end you may be better off manipulating intf->pm_usage_cnt directly. That's what I had to do in the hub driver. Oh yes, there's one detail I forgot to mention before. You need to set the supports_autosuspend flag in the usb_driver structure (can be done statically) and the needs_remote_wakeup flag in the usb_interface structure (must be done during probe). Alan Stern ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel