diff mbox series

[net-next] net: stmmac: failure to probe without MAC interface specified

Message ID E1qayn0-006Q8J-GE@rmk-PC.armlinux.org.uk (mailing list archive)
State Accepted
Commit b5947239bfa666afd05ce0fc02b9c41ec8209e88
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: stmmac: failure to probe without MAC interface specified | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1330 this patch: 1330
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 1353 this patch: 1353
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1353 this patch: 1353
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Russell King (Oracle) Aug. 29, 2023, 1:29 p.m. UTC
Alexander Stein reports that commit a014c35556b9 ("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>
---
I don't think the net tree is up to date with the net-next, so this
patch needs applying to net-next preferably before the pull request
to fix a regression.

Thanks.

 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Alexander Stein Aug. 29, 2023, 2:05 p.m. UTC | #1
Am Dienstag, 29. August 2023, 15:29:50 CEST schrieb Russell King (Oracle):
> Alexander Stein reports that commit a014c35556b9 ("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>
> ---
> I don't think the net tree is up to date with the net-next, so this
> patch needs applying to net-next preferably before the pull request
> to fix a regression.

On top of next-20230829:
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>

Thanks

> Thanks.
> 
>  drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index
> 35f4b1484029..0f28795e581c 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -419,9 +419,8 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8
> *mac) return ERR_PTR(phy_mode);
> 
>  	plat->phy_interface = phy_mode;
> -	plat->mac_interface = stmmac_of_get_mac_mode(np);
> -	if (plat->mac_interface < 0)
> -		plat->mac_interface = plat->phy_interface;
> +	rc = stmmac_of_get_mac_mode(np);
> +	plat->mac_interface = rc < 0 ? plat->phy_interface : rc;
> 
>  	/* Some wrapper drivers still rely on phy_node. Let's save it while
>  	 * they are not converted to phylink. */
patchwork-bot+netdevbpf@kernel.org Aug. 31, 2023, 1:40 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 29 Aug 2023 14:29:50 +0100 you wrote:
> Alexander Stein reports that commit a014c35556b9 ("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>
> 
> [...]

Here is the summary with links:
  - [net-next] net: stmmac: failure to probe without MAC interface specified
    https://git.kernel.org/netdev/net/c/b5947239bfa6

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 35f4b1484029..0f28795e581c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -419,9 +419,8 @@  stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
 		return ERR_PTR(phy_mode);
 
 	plat->phy_interface = phy_mode;
-	plat->mac_interface = stmmac_of_get_mac_mode(np);
-	if (plat->mac_interface < 0)
-		plat->mac_interface = plat->phy_interface;
+	rc = stmmac_of_get_mac_mode(np);
+	plat->mac_interface = rc < 0 ? plat->phy_interface : rc;
 
 	/* Some wrapper drivers still rely on phy_node. Let's save it while
 	 * they are not converted to phylink. */