From mboxrd@z Thu Jan 1 00:00:00 1970 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 10AB0329C7B; Thu, 19 Feb 2026 12:51:10 +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=1771505472; cv=none; b=Bw4nmhLUaMRn/cfpPZ+sbe3DZwYe/4KnN5Uoq7h2JgZHJ69iWRctd1nkVIsiUMn+3xHer7tVgRUZb0w3LnTIkLYKifHpfljRqbkundXWIbKpAqdFL8Wz7GDIEENL4klG70pZe4LiM/Ia2DT2qnijsTJCGU97MqNVZYeyw2cv9Bs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771505472; c=relaxed/simple; bh=nC5t7SDBTEBhLw0bVxD6/00ap3+vj0QOJKxyJEynneQ=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=DRq9KMFbYZtrdSqe6TNjD3/Jtqj4eX5jFHyuyMH4EtDKadTH1D2Fse/cS8z7MMEmExHKigBFWGRCcRecV7cdWpvmOux/IG4SvBqJGY2UFWGudFA99hZA+TptWjVHXK0gwe8XdtF6gP4tCsRcdf7FOWM7teHXHxpPwUtVx6vyRZI= 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=Jh5eabbW; 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="Jh5eabbW" 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=4VS+KEjGXuJEzhnOqlg1bfEz5orBdl+ayaC6AFBwido=; b=Jh5eabbW9/QzBmAdmMuRteFqSP hfrkLwK/5PNMcJvz1aVsMTXnSJgm27lNuAJV1HwsT982WDXsA7zmfCkaGXGHcIlJYcS9IGPheQsDH U1P4bctKyJzvjyozc8Gpz5t8Q/oBRCYxyxFaA9Qr68kbZuLnz60iedufX3V+obRpb1FElXH4tp12Z agzrRcjij8RXA/Jpor+T1fRws8Ug+ALDmTXLspPJz0xKPx3bNWwF23vXDE46lMzOdQLlX5v3Bhe85 lbWXvqfGLVs9ArV49Gu+byufhTy0e4dgWSIatHt/BGL3l/ejNxpuPbmzv/pypSR/iYZ2v+lvL+33K LUUstYBQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:46432 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.98.2) (envelope-from ) id 1vt3Uj-000000000t0-0FMy; Thu, 19 Feb 2026 12:51:01 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1vt3Uh-0000000A5eW-39AZ; Thu, 19 Feb 2026 12:50:59 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn Cc: Alexandre Torgue , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-phy@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Mohd Ayaan Anwar , Neil Armstrong , netdev@vger.kernel.org, Paolo Abeni , Vinod Koul Subject: [PATCH RFC net-next+ 7/9] phy: qcom-sgmii-eth: remove qcom_dwmac_sgmii_phy_interface() 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: Thu, 19 Feb 2026 12:50:59 +0000 Now that qcom_dwmac_sgmii_phy_interface() only serves to validate the passed interface mode, combine it with qcom_dwmac_sgmii_phy_validate(), and use qcom_dwmac_sgmii_phy_validate() to validate the mode in qcom_dwmac_sgmii_phy_set_mode(). Signed-off-by: Russell King (Oracle) --- drivers/phy/qualcomm/phy-qcom-sgmii-eth.c | 27 +++++++++-------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/phy/qualcomm/phy-qcom-sgmii-eth.c b/drivers/phy/qualcomm/phy-qcom-sgmii-eth.c index 58ff15601206..6332ff291fdf 100644 --- a/drivers/phy/qualcomm/phy-qcom-sgmii-eth.c +++ b/drivers/phy/qualcomm/phy-qcom-sgmii-eth.c @@ -290,7 +290,9 @@ static int qcom_dwmac_sgmii_phy_power_off(struct phy *phy) return 0; } -static int qcom_dwmac_sgmii_phy_interface(enum phy_mode mode, int submode) +static int qcom_dwmac_sgmii_phy_validate(struct phy *phy, enum phy_mode mode, + int submode, + union phy_configure_opts *opts) { if (mode != PHY_MODE_ETHERNET) return -EINVAL; @@ -298,7 +300,7 @@ static int qcom_dwmac_sgmii_phy_interface(enum phy_mode mode, int submode) if (submode == PHY_INTERFACE_MODE_SGMII || submode == PHY_INTERFACE_MODE_1000BASEX || submode == PHY_INTERFACE_MODE_2500BASEX) - return submode; + return 0; return -EINVAL; } @@ -307,27 +309,18 @@ static int qcom_dwmac_sgmii_phy_set_mode(struct phy *phy, enum phy_mode mode, int submode) { struct qcom_dwmac_sgmii_phy_data *data = phy_get_drvdata(phy); - int interface; + int ret; - interface = qcom_dwmac_sgmii_phy_interface(mode, submode); - if (interface < 0) - return interface; + ret = qcom_dwmac_sgmii_phy_validate(phy, mode, submode, NULL); + if (ret) + return ret; - if (interface != data->interface) - data->interface = interface; + if (submode != data->interface) + data->interface = submode; return qcom_dwmac_sgmii_phy_calibrate(phy); } -static int qcom_dwmac_sgmii_phy_validate(struct phy *phy, enum phy_mode mode, - int submode, - union phy_configure_opts *opts) -{ - int ret = qcom_dwmac_sgmii_phy_interface(mode, submode); - - return ret < 0 ? ret : 0; -} - static const struct phy_ops qcom_dwmac_sgmii_phy_ops = { .power_on = qcom_dwmac_sgmii_phy_power_on, .power_off = qcom_dwmac_sgmii_phy_power_off, -- 2.47.3