From patchwork Mon Sep 23 14:01:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13809631 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 5459DCF9C70 for ; Mon, 23 Sep 2024 14:09:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Date: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-Owner; bh=hB4I6KNKXW2Of1mZXzVBxj2ILyGc9/N2QyfLd6lRRSE=; b=UQ1hSF8cMzO9BqStfHS4wN32RS vxS8B7HfIXLwmNdbjAbPXcokqtEJF/s2Rh6/32J7YRwbnUgIrG7yEnBjbRuII1K1oe9+zcWpM3F4M egA6gXe9kW/Wi1FNqA73OgeRyoGuyY0bgo8KSJm+vxUO6qKYTIpuGdXZK9eZjlqkkWwPRXDMqCKCm eI5dGEoZbo8GEs6oywka8BwHJNujoUQfyjwmu/uZFvDCyDeG/szffFoIZiz1Z5CufZEjBPl3YgsGi 5BWZXZGBYEg/+gzJOVgLr/i7OQIdIkyNSemCQWzRheUleqfey27X+9YfOB1fCJBR1uKIqJzgHe5yV SCB9yJEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1ssjkV-0000000HLK0-1mUW; Mon, 23 Sep 2024 14:09:11 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1ssjdJ-0000000HKQw-1Aos for linux-arm-kernel@lists.infradead.org; Mon, 23 Sep 2024 14:01:46 +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: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=hB4I6KNKXW2Of1mZXzVBxj2ILyGc9/N2QyfLd6lRRSE=; b=eV/gtFO5ACfI2pgNzUHzlhT/1f 9vNEDev20UCjA0Bek+OhAQzQgrPSbWOAbmJGoLdJU9DuLi6eitAWXTQx2/Ffj2EToUGKbPAa0uBdR 6PBVcPyEZEwQrWpZKP236TqV2adXw0AGMvv/8zs2PHG4m8nzDpSsL04rWCnFydhij2U4pbEeDOV5Y 203YcECJ6Z4Zp0dA/G3hUjI0LEA0B+4pUhpDYu1IG+V+cXB3EQtVTxT9mrkkow8ISDLD5/X79eUXx TugKK/Awr4aGu6/aF+oYCQ+JhW3tAHKeb85mpr7EAp1g2V1EGXCWvPxzZeL7q9hBnIyA9jADoQl98 pPLrFprw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:42210 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 1ssjd6-0004Ih-2u; Mon, 23 Sep 2024 15:01:32 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1ssjd4-005NsF-Gt; Mon, 23 Sep 2024 15:01:30 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Alexandre Torgue , "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Jiawen Wu , Jose Abreu , Jose Abreu , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , Mengyuan Lou , netdev@vger.kernel.org, Paolo Abeni , Vladimir Oltean Subject: [PATCH RFC net-next 07/10] net: dsa: sja1105: call PCS config/link_up via pcs_ops structure MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Mon, 23 Sep 2024 15:01:30 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_070145_342726_8A333D5F X-CRM114-Status: GOOD ( 11.40 ) 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 Call the PCS operations through the ops structure, which avoids needing to export xpcs internal functions. Signed-off-by: Russell King (Oracle) Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean --- drivers/net/dsa/sja1105/sja1105_main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c index b95c64b7e705..8ef1a1931a33 100644 --- a/drivers/net/dsa/sja1105/sja1105_main.c +++ b/drivers/net/dsa/sja1105/sja1105_main.c @@ -2375,6 +2375,7 @@ int sja1105_static_config_reload(struct sja1105_private *priv, for (i = 0; i < ds->num_ports; i++) { struct dw_xpcs *xpcs = priv->xpcs[i]; + struct phylink_pcs *pcs; unsigned int neg_mode; mac[i].speed = mac_speed[i]; @@ -2385,12 +2386,15 @@ int sja1105_static_config_reload(struct sja1105_private *priv, if (!xpcs) continue; + pcs = &xpcs->pcs; + if (bmcr[i] & BMCR_ANENABLE) neg_mode = PHYLINK_PCS_NEG_INBAND_ENABLED; else neg_mode = PHYLINK_PCS_NEG_OUTBAND; - rc = xpcs_do_config(xpcs, priv->phy_mode[i], NULL, neg_mode); + rc = pcs->ops->pcs_config(pcs, neg_mode, priv->phy_mode[i], + NULL, true); if (rc < 0) goto out; @@ -2406,8 +2410,8 @@ int sja1105_static_config_reload(struct sja1105_private *priv, else speed = SPEED_10; - xpcs_link_up(&xpcs->pcs, neg_mode, priv->phy_mode[i], - speed, DUPLEX_FULL); + pcs->ops->pcs_link_up(pcs, neg_mode, priv->phy_mode[i], + speed, DUPLEX_FULL); } }