From patchwork Wed Mar 24 16:50:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 12161719 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 X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB5B7C433E4 for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ACFCD61A11 for ; Wed, 24 Mar 2021 16:51:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236990AbhCXQva (ORCPT ); Wed, 24 Mar 2021 12:51:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:43680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236778AbhCXQvG (ORCPT ); Wed, 24 Mar 2021 12:51:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CDD2D61A11; Wed, 24 Mar 2021 16:51:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616604666; bh=Bqrd7a8qdQzviEJ9iRpTvmEogpJ7AAzj+1nv4IO8P1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KXCE2CxP5Ytm4ecAXvRPu6tuN9H5gDfGu9ewrkU70g+AlMBnZ19rMpDgBZf1383pw RIVvBMqGJ5is6oFAwqpHlxDLf9LNxAS+yra4lm7HYZ77hM3mkyRFl/0+/xUAu0kYsL Km3z8mCWSJwBmugg6TH333q4SsIZMVq60SAwBFVG+HhLBmlUn62gYBs/Dg6cbP8/ol BbgUHx/HL/0VQqFGDYXLzeGFqyYvgh1ZslW5NCOU0CvlEIBz3m9IzFpoYbTIKhYWV1 5pMFqinzlIQ2o2VRn3dpv3EGxOKdAd4nZ9yakezt3Mf+MIh6y3K3uW//nCiHguCSWn 7CV7kIxNS+wNw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org, Andrew Lunn , "David S . Miller" , Florian Fainelli , Heiner Kallweit , Russell King , kuba@kernel.org Cc: =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH net-next 5/7] net: phy: marvell10g: save MACTYPE instead of rate_matching boolean Date: Wed, 24 Mar 2021 17:50:21 +0100 Message-Id: <20210324165023.32352-6-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210324165023.32352-1-kabel@kernel.org> References: <20210324165023.32352-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Save MACTYPE instead of rate_matching boolean. We will need this for other configurations. Signed-off-by: Marek BehĂșn --- drivers/net/phy/marvell10g.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c index 46e853f2d41b..b4f9831b4db6 100644 --- a/drivers/net/phy/marvell10g.c +++ b/drivers/net/phy/marvell10g.c @@ -100,7 +100,7 @@ enum { struct mv3310_priv { u32 firmware_ver; - bool rate_match; + u8 mactype; struct device *hwmon_dev; char *hwmon_name; @@ -486,8 +486,7 @@ static int mv3310_config_init(struct phy_device *phydev) val = phy_read_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL); if (val < 0) return val; - priv->rate_match = ((val & MV_V2_PORT_CTRL_MACTYPE_MASK) == - MV_V2_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH); + priv->mactype = val & MV_V2_PORT_CTRL_MACTYPE_MASK; /* Enable EDPD mode - saving 600mW */ return mv3310_set_edpd(phydev, ETHTOOL_PHY_EDPD_DFLT_TX_MSECS); @@ -601,7 +600,7 @@ static void mv3310_update_interface(struct phy_device *phydev) * 10Gb. The PHY adapts the rate to actual wire speed with help of * internal 16KB buffer. */ - if (priv->rate_match) { + if (priv->mactype == MV_V2_PORT_CTRL_MACTYPE_10GBASER_RATE_MATCH) { phydev->interface = PHY_INTERFACE_MODE_10GBASER; return; }