From: H Hartley Sweeten Date: Wed, 24 Jul 2013 21:09:04 +0000 (-0700) Subject: staging: comedi: usbdux: cleanup the (*detach) X-Git-Tag: v3.12-rc1~183^2~591 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ff14ee8a6e4d9aca3098c47e876bc43f9e4cbe5;p=pandora-kernel.git staging: comedi: usbdux: cleanup the (*detach) 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 Cc: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed