Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1845360pxp; Sun, 13 Mar 2022 00:57:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeA5402PsKFXeqlHqYd97t87SsEt2OPHv3yHyQYons8364/YZVAfatNLwCH6f9TzkTuZo3 X-Received: by 2002:aa7:d80f:0:b0:410:d5c3:f770 with SMTP id v15-20020aa7d80f000000b00410d5c3f770mr15631336edq.279.1647161820694; Sun, 13 Mar 2022 00:57:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647161820; cv=none; d=google.com; s=arc-20160816; b=FcKp6nDM/S+QUxvy2zIu5Vi7IQ9upX4eEE307Zu1VhdCG2gOf6VwsT0LcAL/e1/5Um FPMoJQ7ZJHrkm3KhFrr2vKEAgC9+BEmP0GYADAqFva7HFKtih08apZk7nzgWxPYifrDU oXLuBcmvnFBClZ7LlYJ7OYmCJivtyn0rLiJ4WxqBc1ClNEcUMHyvi24t8iyiZnRXHaCz riqvNe4prucS1kB0p7xLAiGXbtwvWEnrF76G12Wj0S9SO6WcsckR7iC5NGT3Do6ukjss SnPeYUxN4X7vbinFW4hyHUJhScFtEKwcGw9AM1VmIpwOoo1K/KGIDyqyW5aHR2plWnDI yEJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ktKATcRoqLfirbTTmmOyuxW1FnqVXQyfWiJhpDCMKF4=; b=UxO2pBrgF0Ht4c0bUx9+PdzjkwDet+ODkVxxN5PtiOQ2BMEkRDb0RiLjlRlLElUnIR o9+ZK4QPM/qEc+M8ZNsKMC69B5WT4OUdltewKzsE3tVbSEQjA0ZKHx2nODkwzKG2+2A+ CNSCJNury1hUXuIf9V/VlbReoe+O8johpNdTElufyyD9n2EZAb3k/p7BvKJLA4J3hovT rtal1Ep3R1AvSKYn5MLFg6Xw8kFhVJc+b1xlmBc5/HvXgkFifT9qakMhAoWelnjFNm8L fPmxb1wfRZjyM7Yf9S6EJXEgR4XwYgikVk2s3qFDPWyW/YSq2acQD0NaRiP6bXuKMy49 oGqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=DpxX3gSG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a50eacb000000b00412e74b3cb5si3305226edp.179.2022.03.13.00.56.36; Sun, 13 Mar 2022 00:57:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=DpxX3gSG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233251AbiCMA0x (ORCPT + 99 others); Sat, 12 Mar 2022 19:26:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233222AbiCMA0t (ORCPT ); Sat, 12 Mar 2022 19:26:49 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74C6B108773; Sat, 12 Mar 2022 16:25:43 -0800 (PST) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id D8EC1223EF; Sun, 13 Mar 2022 01:25:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1647131142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ktKATcRoqLfirbTTmmOyuxW1FnqVXQyfWiJhpDCMKF4=; b=DpxX3gSGV3LUvJ5DxWoPW4UyAHtzx869/zLzk3YWYc+mJxzbBeuJY52KZcWo4j573XuCfb HTdoofXvotzSIeBXe6MOYLFabjEoxiIklEI4rEacR+6xhuMJkHdDCOZwKUA/U1Av35J0zg 7ucFJZ/kjN7EMoCbvTKpRWCW+mbFdwU= From: Michael Walle To: "David S . Miller" , Jakub Kicinski , Rob Herring , Krzysztof Kozlowski , Andrew Lunn , Heiner Kallweit , Russell King Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH net-next v2 2/3] net: mdio: mscc-miim: replace magic numbers for the bus reset Date: Sun, 13 Mar 2022 01:25:35 +0100 Message-Id: <20220313002536.13068-3-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220313002536.13068-1-michael@walle.cc> References: <20220313002536.13068-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace the magic numbers by macros which are already defined. It seems the original commit missed to use them. Signed-off-by: Michael Walle --- drivers/net/mdio/mdio-mscc-miim.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc-miim.c index 64fb76c1e395..7773d5019e66 100644 --- a/drivers/net/mdio/mdio-mscc-miim.c +++ b/drivers/net/mdio/mdio-mscc-miim.c @@ -158,18 +158,18 @@ static int mscc_miim_reset(struct mii_bus *bus) { struct mscc_miim_dev *miim = bus->priv; int offset = miim->phy_reset_offset; + int mask = PHY_CFG_PHY_ENA | PHY_CFG_PHY_COMMON_RESET | + PHY_CFG_PHY_RESET; int ret; if (miim->phy_regs) { - ret = regmap_write(miim->phy_regs, - MSCC_PHY_REG_PHY_CFG + offset, 0); + ret = regmap_write(miim->phy_regs, offset, 0); if (ret < 0) { WARN_ONCE(1, "mscc reset set error %d\n", ret); return ret; } - ret = regmap_write(miim->phy_regs, - MSCC_PHY_REG_PHY_CFG + offset, 0x1ff); + ret = regmap_write(miim->phy_regs, offset, mask); if (ret < 0) { WARN_ONCE(1, "mscc reset clear error %d\n", ret); return ret; @@ -272,7 +272,7 @@ static int mscc_miim_probe(struct platform_device *pdev) miim = bus->priv; miim->phy_regs = phy_regmap; - miim->phy_reset_offset = 0; + miim->phy_reset_offset = MSCC_PHY_REG_PHY_CFG; ret = of_mdiobus_register(bus, pdev->dev.of_node); if (ret < 0) { -- 2.30.2