diff options
author | LABBE Corentin <clabbe.montjoie@gmail.com> | 2017-05-31 09:18:33 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-06-01 14:53:03 -0400 |
commit | ec33d71de7309c50531c2ae0eb178244899e6e46 (patch) | |
tree | 4b4f40d2f9482a25a1ebc4e9e40dc79012cbddd6 /drivers/net/ethernet/stmicro | |
parent | 3874191898675ac34b6d1d94cfe997c570492bbb (diff) |
net-next: stmmac: add optional setup function
Instead of adding more ifthen logic for adding a new mac_device_info
setup function, it is easier to add a function pointer to the function
needed.
Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro')
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index f158273eab9b..c80c9c3b67db 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3933,7 +3933,9 @@ static int stmmac_hw_init(struct stmmac_priv *priv) struct mac_device_info *mac; /* Identify the MAC HW device */ - if (priv->plat->has_gmac) { + if (priv->plat->setup) { + mac = priv->plat->setup(priv); + } else if (priv->plat->has_gmac) { priv->dev->priv_flags |= IFF_UNICAST_FLT; mac = dwmac1000_setup(priv->ioaddr, priv->plat->multicast_filter_bins, |