]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gianfar: Cleanup/Fix gfar_probe and the hw init code
authorClaudiu Manoil <claudiu.manoil@freescale.com>
Mon, 17 Feb 2014 10:53:14 +0000 (12:53 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Feb 2014 20:03:01 +0000 (15:03 -0500)
commit208627883ecfaa182c266eb67178bb71d392af54
tree92514547385e7083c09cd05c247a59a29662a614
parentc85fde8336ec6c062d65a5c1bca2ca78028111ae
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 <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/gianfar.c
drivers/net/ethernet/freescale/gianfar.h