From patchwork Tue Aug 29 13:29:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13368978 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5BF2EC6FA8F for ; Tue, 29 Aug 2023 13:30:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=DPxhCA7k/ram1akmiAXArEeUF/Bor9n7hfcZdR5p/fA=; b=p7YKnNynNnjehA tlMyXFhjIauMVYgCuOAR4Qvw4ssAt79lSefKQKo0Aqpo+0gQuKvR+hZRytV3fj6V8vMn2PL29d/3V WSHvNNH5s4DdWJ9f0K8TLYpPGy9ll4Bs+lrZaQvqf+Yg9eKdIpx+MIpLfvgnEie0bjn5OC6uzXP4I QCGaO7RvX+RXSYGsuccIAn/xm+LIwBxHxo+8yPeQB63CWmOR7kGbj50i+DM9iV0d7YE3ylIjhw9jl 0Tt6yfYswnZ9Ds+gXQ4gv8IZGpCMyIgYj4WT9b8isIxVNcmWjgH7ntDWRFMZin1iAQBaAsfRysycS gMMxpJpfRX446gijOvXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qaynE-00Bb0o-0X; Tue, 29 Aug 2023 13:30:04 +0000 Received: from [2001:4d48:ad52:32c8:5054:ff:fe00:142] (helo=pandora.armlinux.org.uk) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qaynB-00Bb01-16 for linux-arm-kernel@lists.infradead.org; Tue, 29 Aug 2023 13:30:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:Reply-To:Content-ID :Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To: Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0DjC9ZMxD102H+JhE6xrIC7pYAF3Sy1Cq4pNKP95ISo=; b=IHAfui+2D5PmkRyzYMMcFRVUbF W/+LyN4pJIICbtHlxoFQAcev9qqFYcdp7y1Nd9qSEEvOLTVjNqsa4o94UEE5+mow3zIow4470l0mF cUaRA+9EV6xzxGCEGCl+6/PWWeD2XCFLllSPghtFef7u7GsWf30lqIsrGEIN7wr5fyHC8QNys7H83 VXaixUcXQ2VOjwVCcubgHvgag3LNRR+48CyE26fzPIzDH218vsZDHBKUCEQT0ogIk3Vtzw4EP56NH i+w/Pfh3ALQNpswloxyYgsWmAlzp6gaHvlyfAgcw9/HT69AEdaNziIlhzapj0CKn4+YvdyYRJJiu+ s1h9cezA==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:36568 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qayn0-0000WA-0a; Tue, 29 Aug 2023 14:29:50 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qayn0-006Q8J-GE; Tue, 29 Aug 2023 14:29:50 +0100 From: "Russell King (Oracle)" To: Alexandre Torgue , Jose Abreu Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next] net: stmmac: failure to probe without MAC interface specified MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 29 Aug 2023 14:29:50 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230829_063001_397222_4AFBE924 X-CRM114-Status: GOOD ( 12.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Signed-off-by: Russell King (Oracle) Tested-by: Alexander Stein --- 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(-) 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. */