Skip to content

Commit 47653e4

Browse files
paulkocialkowskikuba-moo
authored andcommitted
net: dwmac-sun8i: Use parsed internal PHY address instead of 1
While the MDIO address of the internal PHY on Allwinner sun8i chips is generally 1, of_mdio_parse_addr is used to cleanly parse the address from the device-tree instead of hardcoding it. A commit reworking the code ditched the parsed value and hardcoded the value 1 instead, which didn't really break anything but is more fragile and not future-proof. Restore the initial behavior using the parsed address returned from the helper. Fixes: 634db83 ("net: stmmac: dwmac-sun8i: Handle integrated/external MDIOs") Signed-off-by: Paul Kocialkowski <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Acked-by: Corentin LABBE <[email protected]> Tested-by: Corentin LABBE <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b80b43f commit 47653e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ static int sun8i_dwmac_set_syscon(struct device *dev,
964964
/* of_mdio_parse_addr returns a valid (0 ~ 31) PHY
965965
* address. No need to mask it again.
966966
*/
967-
reg |= 1 << H3_EPHY_ADDR_SHIFT;
967+
reg |= ret << H3_EPHY_ADDR_SHIFT;
968968
} else {
969969
/* For SoCs without internal PHY the PHY selection bit should be
970970
* set to 0 (external PHY).

0 commit comments

Comments
 (0)