net: stmmac: Move MAC caps init to phylink MAC caps getter
authorSerge Semin <fancer.lancer@gmail.com>
Fri, 19 Apr 2024 09:03:06 +0000 (12:03 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 23 Apr 2024 10:25:35 +0000 (12:25 +0200)
commitf951a64922a8576975673c42985a89a798e19b4e
tree0527a6d72f3b7692f6ff893aa9bed06a9ebc5a17
parentdc144baeb4fbfa0d91ce9c3875307566f58704ec
net: stmmac: Move MAC caps init to phylink MAC caps getter

After a set of recent fixes the stmmac_phy_setup() and
stmmac_reinit_queues() methods have turned to having some duplicated code.
Let's get rid from the duplication by moving the MAC-capabilities
initialization to the PHYLINK MAC-capabilities getter. The getter is
called during each network device interface open/close cycle. So the
MAC-capabilities will be initialized in generic device open procedure and
in case of the Tx/Rx queues re-initialization as the original code
semantics implies.

Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Romain Gantois <romain.gantois@bootlin.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c