- The usb_interface structure pointer will be no longer stored - Every access to the USB will be handled trought the usb_interface pointer- Add a new bool 'connected' for signaling a disconnect (== false)- Handle a non blocking read without blocking- Code cleanup- Synchronize disconnect() handler with open() and release(), to fix races- Introduced fsync- Single user mode- Eliminated dead code- Save some bytes in the dev structure

Some word about the open()/release() races with disconnect() of an USB device(which can happen any time):- The return interface pointer from usb_find_interface() could be already owned by an other driver and no more longer handle by the skeleton driver.- Or the dev pointer return by usb_get_intfdata() could point to an already release memory.

This races can not handled by a per device mutex. Only a driver global mutexcould do this job, since the kref_put() in the skel_disconnect() must beprotected, otherwise skel_open() could access an already released memory.

I know that this races are very small, but on heavy load or misdesigned or buggyhardware this could lead in a OOPS or unpredictable behavior.

The patch is against linux 3.5.0 commit eea5b5510fc5545d15b69da8e485a7424ae388cf