net: stmmac: add set_mac to the stmmac_ops
authorLABBE Corentin <clabbe.montjoie@gmail.com>
Thu, 23 Mar 2017 13:40:22 +0000 (14:40 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 24 Mar 2017 19:36:42 +0000 (12:36 -0700)
commit270c7759fbbc99e1ed00259c752a8c53f31cfb27
treebc7054fc4d07f9d764d2020da65e74700380170a
parentaff55a3638a2d13de5cf0b0c45993378282cbe91
net: stmmac: add set_mac to the stmmac_ops

Two different set_mac functions exists but stmmac_dwmac4_set_mac() is
only used for enabling and never for disabling.
So on dwmac4, the MAC RX/TX is never disabled.

This patch add a generic function pointer set_mac() to stmmac_ops and
replace all call to stmmac_set_mac/stmmac_dwmac4_set_mac by a call to
this pointer.

Since dwmac4_ops is const, set_mac cannot be modified after, and so dwmac4_ops
is duplioacted like dwmac4_dma_ops.

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/common.h
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c