Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6418325DCFF for ; Mon, 14 Apr 2025 09:06:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744621616; cv=none; b=MwetDEfcXfdkA+iOv6czJXx8STTY37PGZo0NsVTuVVrFXRmtsqSKElFUhmNR9/sHnL1Uk9jGA0apkMP5NB3aQN5W12YvzU+m1XhV1cnTy6qcVJM/XLSWLPg2Yhmbc/5U8bUAne/wh/TrnA4Hwe0Hk0HjhaVnxwrkZYQs3CmCsGw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744621616; c=relaxed/simple; bh=iBhaeDDwdtFtGUkwcNaJeL3jnUzPSY6Wyon52OA0Z20=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=b0mKbj59bMvX+fZdxuirW8WQ7R5vblNRtoE8pfAr2MfqPtR3GrTCpfnNevSLwLGrx0YqEQnLJb9FW4qs2NGcLOJ0cjd+wgzeccUNpDlYtMeLJsk9bCVOLpqfQsg3M7CtXpEoiBpyabvxEaH3KJLrAbvTNgsfnbrCGBf1k5+49ec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=ud6F4mT5; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="ud6F4mT5" 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:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wOqlWtFSPV7O6xwum69lDdpSmcDreIi287vOPBtUK1g=; b=ud6F4mT5ycwwzMR0SWj57hOdK0 eJrhqgZZR0WcP7CX1KTr0T44rMI875/x5gmuu+UXquOYe7nSF+wTH/+j8ka4v47mN92CTgY/UJ+Kf S9DF/5zXIZlyjJYNHgIk4Ov01r01aZbIW+LnUcsHp+Hi9lEuaWz5HzG6N2vdCw1qDfx1HvoOZuV/y vsvrZGwcGZuImWPKlfLoKHksUL6PBE5o6oyox8baN8O/Zjkifh94J+S4fN7PcYeJz/4xdWTMa5jNQ k63oTHVgWbhBpbTWkgT7j2kW1PAGXp/UPyPuPBoC60MiWPk04/TpRScnU2Zn4vBKnbVGLS3+imZqe CRMruvSQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:41504 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 1u4Fm6-0006Cb-1r; Mon, 14 Apr 2025 10:06:42 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1u4FlV-000XjG-83; Mon, 14 Apr 2025 10:06:05 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next v2 2/4] net: stmmac: anarion: clean up interface parsing Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" Message-Id: Sender: Russell King Date: Mon, 14 Apr 2025 10:06:05 +0100 anarion_config_dt() used a switch statement to check for the RGMII modes, complete with an unnecessary "fallthrough", and also printed the numerical value of the PHY interface mode on error. Clean this up using the phy_interface_mode_is_rgmii() helper, and print the English version of the PHY interface mode on error. Reviewed-by: Andrew Lunn Signed-off-by: Russell King (Oracle) --- .../net/ethernet/stmicro/stmmac/dwmac-anarion.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c index 232aae752690..941ea724c643 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-anarion.c @@ -79,17 +79,11 @@ anarion_config_dt(struct platform_device *pdev, gmac->ctl_block = ctl_block; - switch (plat_dat->phy_interface) { - case PHY_INTERFACE_MODE_RGMII: - fallthrough; - case PHY_INTERFACE_MODE_RGMII_ID: - case PHY_INTERFACE_MODE_RGMII_RXID: - case PHY_INTERFACE_MODE_RGMII_TXID: + if (phy_interface_mode_is_rgmii(plat_dat->phy_interface)) { gmac->phy_intf_sel = GMAC_CONFIG_INTF_RGMII; - break; - default: - dev_err(&pdev->dev, "Unsupported phy-mode (%d)\n", - plat_dat->phy_interface); + } else { + dev_err(&pdev->dev, "Unsupported phy-mode (%s)\n", + phy_modes(plat_dat->phy_interface)); return ERR_PTR(-ENOTSUPP); } -- 2.30.2