From patchwork Wed Oct 16 09:58:39 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: 13838073 X-Patchwork-Delegate: kuba@kernel.org 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 75F2D206945 for ; Wed, 16 Oct 2024 09:58:44 +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=1729072725; cv=none; b=qoxd2ddRJyBgKy+JzTdwsGyOOuUA37mi9Fy3AD1xALuAmyR0bO8n+ue5aEK+sGL8uhJXLRhZ5XkWtKILJvq3i4/AFUsE874X/RHQMT536jIzbhvj9ALS9T0AragdtXBOb6rCC5Jx4SVuyZh+1CDJX/g9BXA77Mtq3j26YHrwH38= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072725; c=relaxed/simple; bh=FvdU3DWKUgbVK0XVFHzYPLnVuo12X0juTD45vbPEdxc=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=s6WW7zirBUOhmxL3H5LDj2oS9vw2EYBWl69VnBn2vdA16STJAG6PmOaqZuJUtOcSSQHpe7rBuysxmssvmLJkNX/IZx6Tr4zrVRiAj60xn04XFYIgl2O285gTq8Q1zTtC3MA8VnIAMkuT30IHut4GC0QyhQ47g1p17GN58odXaQ0= 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=e858bfZL; 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="e858bfZL" 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=nSSQDQ5g/lLOl8168V5Cn4WsFtWFef0UUUyBDXjq6Mk=; b=e858bfZLJxPDHYL1PrYo3lNYNW iVn1cBeGb03tBfKC07tagwIqBzHYtqayOakzEDTI6D0aagi+yBsspCdk9DsstY2JGjF594Vs9+PN9 FQLx+oayk51jiPOLmECfKwqKYtkL77+8krgVaufBRZ/AcFKuCkUJWBPVt3TKy8xv35E0E8sTzKEII Wy32cm0/0b7vHKi5TY9YFF++0iLSTHVtUF63AIcGSHcVSJgE5ifCsIgVCNlT2SLgBg9qErx6RXdOS UkRVk8/+jGFxby6tRHtUmAz6+8vmOIl/LHL4rbAjcNtBm6fYLc0ad+CDt0KsCWuOPSfOfg9BC2xC5 oYPoKnlw==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:59086 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 1t10nf-0004s6-2L; Wed, 16 Oct 2024 10:58:40 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1t10nf-000AWi-PR; Wed, 16 Oct 2024 10:58:39 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: "David S. Miller" , Eric Dumazet , Florian Fainelli , Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni , Vladimir Oltean Subject: [PATCH net-next v2 4/5] net: phylink: remove use of pl->pcs in phylink_validate_mac_and_pcs() Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Wed, 16 Oct 2024 10:58:39 +0100 X-Patchwork-Delegate: kuba@kernel.org When the mac_select_pcs() method is not implemented, there is no way for pl->pcs to be set to a non-NULL value. This was here to support the old phylink_set_pcs() method which has been removed a few years ago. Simplify the code in phylink_validate_mac_and_pcs(). Signed-off-by: Russell King (Oracle) Reviewed-by: Vladimir Oltean --- drivers/net/phy/phylink.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index aa1139efc7e4..94f3c5fd09ed 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -649,8 +649,8 @@ static int phylink_validate_mac_and_pcs(struct phylink *pl, unsigned long *supported, struct phylink_link_state *state) { + struct phylink_pcs *pcs = NULL; unsigned long capabilities; - struct phylink_pcs *pcs; int ret; /* Get the PCS for this interface mode */ @@ -658,8 +658,6 @@ static int phylink_validate_mac_and_pcs(struct phylink *pl, pcs = pl->mac_ops->mac_select_pcs(pl->config, state->interface); if (IS_ERR(pcs)) return PTR_ERR(pcs); - } else { - pcs = pl->pcs; } if (pcs) {