Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: marvell: Rename mii_lpa_to_linkmode_lpa_t

Rename mii_lpa_to_linkmode_lpa_t to mii_lpa_mod_linkmode_lpa_t to
indicate it modifies the passed linkmode bitmap, without clearing any
other bits.

Also, ensure bit are clear which the lpa indicates should not be set.

Fixes: c0ec3c273677 ("net: phy: Convert u32 phydev->lp_advertising to linkmode")
Suggested-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Andrew Lunn and committed by
David S. Miller
ab9cb729 78a24df3

+11 -11
+11 -11
drivers/net/phy/marvell.c
··· 1047 1047 } 1048 1048 1049 1049 /** 1050 - * fiber_lpa_to_linkmode_lpa_t 1050 + * fiber_lpa_mod_linkmode_lpa_t 1051 1051 * @advertising: the linkmode advertisement settings 1052 1052 * @lpa: value of the MII_LPA register for fiber link 1053 1053 * 1054 - * A small helper function that translates MII_LPA 1055 - * bits to linkmode LP advertisement settings. 1054 + * A small helper function that translates MII_LPA bits to linkmode LP 1055 + * advertisement settings. Other bits in advertising are left 1056 + * unchanged. 1056 1057 */ 1057 - static void fiber_lpa_to_linkmode_lpa_t(unsigned long *advertising, u32 lpa) 1058 + static void fiber_lpa_mod_linkmode_lpa_t(unsigned long *advertising, u32 lpa) 1058 1059 { 1059 - if (lpa & LPA_FIBER_1000HALF) 1060 - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, 1061 - advertising); 1062 - if (lpa & LPA_FIBER_1000FULL) 1063 - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, 1064 - advertising); 1060 + linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, 1061 + advertising, lpa & LPA_FIBER_1000HALF); 1062 + 1063 + linkmode_mod_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, 1064 + advertising, lpa & LPA_FIBER_1000FULL); 1065 1065 } 1066 1066 1067 1067 /** ··· 1146 1146 } 1147 1147 } else { 1148 1148 /* The fiber link is only 1000M capable */ 1149 - fiber_lpa_to_linkmode_lpa_t(phydev->lp_advertising, lpa); 1149 + fiber_lpa_mod_linkmode_lpa_t(phydev->lp_advertising, lpa); 1150 1150 1151 1151 if (phydev->duplex == DUPLEX_FULL) { 1152 1152 if (!(lpa & LPA_PAUSE_FIBER)) {