1 From 99d0f3a1095f4c938b1665025c29411edafe8a01 Mon Sep 17 00:00:00 2001
2 From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
3 Date: Tue, 21 Mar 2023 15:58:44 +0000
4 Subject: [PATCH] net: dpaa2-mac: use Autoneg bit rather than an_enabled
6 The Autoneg bit in the advertising bitmap and state->an_enabled are
7 always identical. Thus, we will be removing state->an_enabled.
9 Use the Autoneg bit in the advertising bitmap to indicate whether
10 autonegotiation should be used, rather than using the an_enabled
11 member which will be going away. This means we use the same condition
12 as phylink_mii_c22_pcs_config().
14 Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
15 Reviewed-by: Simon Horman <simon.horman@corigine.com>
16 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
18 drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 3 ++-
19 1 file changed, 2 insertions(+), 1 deletion(-)
21 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
22 +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
23 @@ -158,7 +158,8 @@ static void dpaa2_mac_config(struct phyl
24 struct dpmac_link_state *dpmac_state = &mac->state;
27 - if (state->an_enabled)
28 + if (linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
29 + state->advertising))
30 dpmac_state->options |= DPMAC_LINK_OPT_AUTONEG;
32 dpmac_state->options &= ~DPMAC_LINK_OPT_AUTONEG;