Skip to content

Commit b594723

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: stmmac: failure to probe without MAC interface specified
Alexander Stein reports that commit a014c35 ("net: stmmac: clarify difference between "interface" and "phy_interface"") caused breakage, because plat->mac_interface will never be negative. Fix this by using the "rc" temporary variable in stmmac_probe_config_dt(). Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> Link: https://lore.kernel.org/r/E1qayn0-006Q8J-GE@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent e4da8c7 commit b594723

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
419419
return ERR_PTR(phy_mode);
420420

421421
plat->phy_interface = phy_mode;
422-
plat->mac_interface = stmmac_of_get_mac_mode(np);
423-
if (plat->mac_interface < 0)
424-
plat->mac_interface = plat->phy_interface;
422+
rc = stmmac_of_get_mac_mode(np);
423+
plat->mac_interface = rc < 0 ? plat->phy_interface : rc;
425424

426425
/* Some wrapper drivers still rely on phy_node. Let's save it while
427426
* they are not converted to phylink. */

0 commit comments

Comments
 (0)