From b876e985c2273b7bd2d5539f2147ef69f7701129 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Fri, 20 Jun 2014 11:10:35 -0700 Subject: [PATCH] staging: comedi: mite: cleanup mite_unsetup() This function is only called by comedi drivers during the (*detach) of the driver. After it is called mite_free() is always called to kfree the allocated mite_struct pointer. Rename this function to mite_detach() and merge the kfree() from mite_free() into it. Remove the unnecessary clearing of the mite variables since the mite pointer is going to be kfree()'d anyway. The mite_detach() function checks if the pointer is valid so remove the unnecessary checks in the callers. The check can also be removed in ni_660x since the ni_660x_free_mite_rings() function does not actually need the 'mite' pointer. Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- Reading git-format-patch failed