From patchwork Wed May 29 13:29:19 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: 13678834 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 08C9911CAB for ; Wed, 29 May 2024 13:29:27 +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=1716989369; cv=none; b=bTByLfxpmw8jvxOTiW6OupKZcoifDAwL7vP6v2HNIQZLYZ/Qq2+aTJ6eT470v0gMiOh6L00CjH8H2O26sCG6MjXPaLLstzbEV4g+MwehJhXPcjZshxo6MnceTsHPLrNNRpGqrbXom9dLoWKwJzG4tHqi7WdomjaAHBUvmmdV5dg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716989369; c=relaxed/simple; bh=0cC26AS9RA8hgkXnPY6c1Jk6MvSh7crAichKJm3IVqU=; h=In-Reply-To:References:From:To:Cc:Subject:MIME-Version: Content-Disposition:Content-Type:Message-Id:Date; b=SDZvu2buLaT9CAybPtZ6nG1iegAjw1jrohbzIH723niPNadQheIrfZLl/5bRiNldFeV82mnyUUKpn7yMfN1ET8BrZgSoLpv0k1uPfASIxN3olCr+O/80hQTMZj8rNcGoNswfMS0HnFiHgBhs6O+XjD5pqUPXUfmAHauAQFYTlM8= 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=z2/azBst; 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="z2/azBst" 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=vn0jH6CU7KHQ/wpW+WUjXbY6CCLADkErWHq5wcQ5KPY=; b=z2/azBstyNEE8fNK9RO/j3URxN /HMqBM8QpLyXTMJbSNeb8o8BQHN0jiih+1BHVS2uc/ULIL/jlUM3h45zbaq3yN6Vo0eYg7pbbcG2o qg0ELOzgeZ7f1MC1jZ/lo2xMhb3stSMTCMxsRElBTyqFQO2MQg7PCuLjOJhMdfPXCuA6c/CSOwQYm y4Il0ybXHByyM3RoIZ5e6O4PNnJTo5nkoM23OQLs4Uc8ueIBA5Ovc3PT+6wgSBCLjQurjoTMKaw8F +ASv9Ok3s6WAog/ESr1UjOjvUmmDYgRaM+5NrYFN+xFeltKi0UYYEt8B+A3yTXxZ0SSjo07ZBB7GX UHvi0hVQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:33424 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 1sCJMi-00069t-39; Wed, 29 May 2024 14:29:17 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sCJMl-00Ecqp-K0; Wed, 29 May 2024 14:29:19 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: Andrew Halaney , Serge Semin , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: [PATCH net-next 1/6] net: phylink: rearrange phylink_parse_mode() 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, 29 May 2024 14:29:19 +0100 X-Patchwork-Delegate: kuba@kernel.org Of the two users of phylink_config->ovr_an_inband, both manually check for a fixed link before setting this flag (or clearing it if they find a fixed link.) This is unnecessary complication. Rearrange phylink_parse_mode() a little so we can change how phylink_config->ovr_an_inband works. This will allow the flag to be tested before checking for the fixed link properties in the next patch. Signed-off-by: Russell King (Oracle) --- drivers/net/phy/phylink.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 994471fad833..5abd12713598 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -899,12 +899,15 @@ static int phylink_parse_mode(struct phylink *pl, return -EINVAL; } + pl->cfg_link_an_mode = MLO_AN_INBAND; + } + + if (pl->cfg_link_an_mode == MLO_AN_INBAND) { linkmode_zero(pl->supported); phylink_set(pl->supported, MII); phylink_set(pl->supported, Autoneg); phylink_set(pl->supported, Asym_Pause); phylink_set(pl->supported, Pause); - pl->cfg_link_an_mode = MLO_AN_INBAND; switch (pl->link_config.interface) { case PHY_INTERFACE_MODE_SGMII: