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 7995F285C88; Tue, 16 Sep 2025 21:47:01 +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=1758059223; cv=none; b=stQ9BpYxDvBotHJI3zu7k4X8LVpbbZbsGq1NboRwBj0+XPznSHkF+u6c5te+MFiv9FYDXsc5GMFHQvZHWS8oNWuNQ4gqxDP7kUZkPnujpmbwmgD/qXh9F1zPjaHo52n2kYfDHH0Cj/K8Sfci5/Yqpzfu4U1V/Qt5fDyj+JF5Wqw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758059223; c=relaxed/simple; bh=N/jZ386+GpqSkA9IYz+JAUdQFRFoYG03bPULdFGwi/0=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=DrTApvkl/GjGOF4pvOMSHQa+VgZvmTGAD6ngOBiZbrF60EO5P1e9b4gzIFAvsX+3awVU5sw6KHWIar6vcQXhjgyyS8yT0mXlHj+KtykLj8gXBWO7Gnwh9gkUKIqFl23Im0KaSVUmEturhj1WLEC9s57vcBuI/gTsh4yJ/Xt9pwA= 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=YFFy8o15; 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="YFFy8o15" 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=zlqNRYOof33no4pPk+a240zjTMOoqot7KzVUkbs+y20=; b=YFFy8o15Xu+5WLqpxgGC8hf6Xo iI9HCJ3cJLthKpJEOMtZfu2GMvAPFL95hhF36XFgr/5y/GyZY1Ep6jcvtg1Rzf742nAZegafj6/eR 3foBT0RavoXR04YTBCjqUwD9NtnH8vWqDJ+9uWEiaP0RWjZv5Ow3FnqwR5PPOoylzu69O05FZnwAL LsA8F2S2guOof+zEmbXGuptqsgek9aUrONtYPNYEpnOMSrXw7DM3H11jzA8GYNzj/Wp0vTleMbdJ/ /0stYh3zFUM8iJvB4y4dNE94qjavmZNk3gq59Loi91WE/Q35O/zwvp/S+HL+U+pc7f7Lmw4xh9qlq QCMBGAkg==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:44856 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 1uydVp-000000006Pr-3Npj; Tue, 16 Sep 2025 22:46:57 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.98.2) (envelope-from ) id 1uydVp-000000061WW-08YM; Tue, 16 Sep 2025 22:46:57 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , linux-arm-msm@vger.kernel.org, "Marek Beh__n" , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 5/7] net: phylink: use sfp_get_module_caps() Precedence: bulk X-Mailing-List: linux-arm-msm@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: Tue, 16 Sep 2025 22:46:57 +0100 Use sfp_get_module_caps() to get SFP module's capabilities. Signed-off-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 1b06805f1bd7..9d7799ea1c17 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -3750,17 +3750,18 @@ static int phylink_sfp_config_optical(struct phylink *pl) static int phylink_sfp_module_insert(void *upstream, const struct sfp_eeprom_id *id) { + const struct sfp_module_caps *caps; struct phylink *pl = upstream; ASSERT_RTNL(); - linkmode_zero(pl->sfp_support); - phy_interface_zero(pl->sfp_interfaces); - sfp_parse_support(pl->sfp_bus, id, pl->sfp_support, pl->sfp_interfaces); - pl->sfp_port = sfp_parse_port(pl->sfp_bus, id, pl->sfp_support); + caps = sfp_get_module_caps(pl->sfp_bus); + phy_interface_copy(pl->sfp_interfaces, caps->interfaces); + linkmode_copy(pl->sfp_support, caps->link_modes); + pl->sfp_may_have_phy = caps->may_have_phy; + pl->sfp_port = caps->port; /* If this module may have a PHY connecting later, defer until later */ - pl->sfp_may_have_phy = sfp_may_have_phy(pl->sfp_bus, id); if (pl->sfp_may_have_phy) return 0; -- 2.47.3