On Sun, 20 Mar 2005, Nick Sillik wrote: > I see that unusual devs have an initFunction, which is exactly what I need. > The > only problem is that I also need a function to be run on disconnect. Right now > I'm running my own code it in usb_stor_acquire_resources and > usb_store_release_resources. The initFunction of an unusual dev covers the > former, how should I cover the latter. It seems silly to just do a mix of the > two. > > Any ideas?
In addition to the initFunction there's also an extra_destructor (see the usb_stor_release_resources routine) you can use. And while you're at it, please make sure the comments remain up to date along with the code. You've got comments talking about the value returned by a function that actually returns void, among other things. And delete completely the "wrapper" definition that is #if-ed out. And move the #include lines for linux/config.h, linux/input.h, and usb.h out of the onetouch.h header file into the onetouch.c source file. Those #includes aren't needed in usb.c, the only other place where onetouch.h is needed. And please change this: #ifndef CONFIG_USB_STORAGE_ONETOUCH ... #endif #ifdef CONFIG_USB_STORAGE_ONETOUCH ... #endif to #ifndef CONFIG_USB_STORAGE_ONETOUCH ... #else ... #endif Alan Stern ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel