From patchwork Tue Mar 21 15:58:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13182909 X-Patchwork-Delegate: kuba@kernel.org 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBD5EC6FD1D for ; Tue, 21 Mar 2023 15:58:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230416AbjCUP64 (ORCPT ); Tue, 21 Mar 2023 11:58:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230338AbjCUP6u (ORCPT ); Tue, 21 Mar 2023 11:58:50 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 057A41632B for ; Tue, 21 Mar 2023 08:58:49 -0700 (PDT) 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=7eQFPzmbZICHHPdtBsQLeQaXsm1dWuSlg/J1w5EQ7xc=; b=pS20j6KqsqmKG4r//jqsEj2XU+ AEfLCyZZzN+b6Yn8Zu/KPfxZee/HmD6cEhnxaKOf41vgrrUbF42Rpq8OScqZfajhdpplXsQg8xZgW 0b1wCX50kF+aQNo+xfC27UeuMg7JTueo97+kGMuEIKs85oL03XtnEwKv3gxFTIBFbC81M3zaB2mv2 ucltFH5zktjdxVGz/q4gS5S6OBh0yIqArQsAUIdPa8qNYUKCPZcgMPYxS7M+8BvtEv1Kh4mIss1AF nrfzTvYyBGXjbRzOPDFyZOsb8lVyIblX5n2dm++mSeNHMltjibKwFT8q9trJy167WV8d6gi/wqOjn Dw0AmS3g==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:56526 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.94.2) (envelope-from ) id 1peeNo-0001Tx-Oz; Tue, 21 Mar 2023 15:58:44 +0000 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1peeNo-00DmhJ-2x; Tue, 21 Mar 2023 15:58:44 +0000 In-Reply-To: References: From: "Russell King (Oracle)" To: Andrew Lunn , Heiner Kallweit Cc: "David S. Miller" , Eric Dumazet , Ioana Ciornei , Jakub Kicinski , Jose Abreu , netdev@vger.kernel.org, Paolo Abeni Subject: [PATCH net-next 1/3] net: dpaa2-mac: use Autoneg bit rather than an_enabled MIME-Version: 1.0 Content-Disposition: inline Message-Id: Sender: Russell King Date: Tue, 21 Mar 2023 15:58:44 +0000 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The Autoneg bit in the advertising bitmap and state->an_enabled are always identical. Thus, we will be removing state->an_enabled. Use the Autoneg bit in the advertising bitmap to indicate whether autonegotiation should be used, rather than using the an_enabled member which will be going away. This means we use the same condition as phylink_mii_c22_pcs_config(). Signed-off-by: Russell King (Oracle) Reviewed-by: Simon Horman --- drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c index c886f33f8c6f..b1871e6c4006 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c @@ -159,7 +159,8 @@ static void dpaa2_mac_config(struct phylink_config *config, unsigned int mode, struct dpmac_link_state *dpmac_state = &mac->state; int err; - if (state->an_enabled) + if (linkmode_test_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, + state->advertising)) dpmac_state->options |= DPMAC_LINK_OPT_AUTONEG; else dpmac_state->options &= ~DPMAC_LINK_OPT_AUTONEG;