The tidy_up() function is only called by the (*detach). That function
unlinks any running urbs and frees all the allocated urbs and buffers
used by the driver.
Rename tidy_up() to usbdux_free_usb_buffers() and move all the parts
that don't deal with the freeing of the buffers directly into the
(*detach).
Also, remove all the unnecessary clearing of the pointers. The comedi
core will kfree() the private data after calling the (*detach).
Foe aesthetic reasons, do the kfree()'ing of the buffers and urbs in
the reverse order that they were allocated.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>