From: Claudiu Manoil Date: Mon, 17 Feb 2014 10:53:14 +0000 (+0200) Subject: gianfar: Cleanup/Fix gfar_probe and the hw init code X-Git-Tag: v3.15-rc1~113^2~317^2~5 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=208627883ecfaa182c266eb67178bb71d392af54;p=pandora-kernel.git gianfar: Cleanup/Fix gfar_probe and the hw init code Factor out gfar_hw_init() to contain all the controller hw initialization steps for a better control of register writes, and to significantly simplify the tangled code from gfar_probe(). This results in code size and stack usage reduction (besides code readability). Fix memory leak on device removal, by freeing the rx_/tx_queue structures. Replace custom bit swapping function with a library one (bitrev8). Move allocation of rx_/tx_queue struct arrays before the group structure init, because in order to assign Rx/Tx queues to groups we need to have the queues first. This also allows earlier bail out of gfar_probe(), in case the memory allocation fails. The flow control checks for maccfg1 were removed from gfar_probe(), since flow control is disabled at probe time (priv->rx_/tx_pause_en are 0). Redundant initializations (by 0) also removed. Signed-off-by: Claudiu Manoil Signed-off-by: David S. Miller --- Reading git-diff-tree failed