Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3556778pxp; Tue, 15 Mar 2022 00:42:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuMHB3Hf0nHIg3A0SCpYM6+UNY7EB2a3yxGZNIXLxDb046RroHuRWF+HOpSpqn20PCF3Wa X-Received: by 2002:a05:6402:151a:b0:416:187f:bf8d with SMTP id f26-20020a056402151a00b00416187fbf8dmr23709865edw.126.1647330161890; Tue, 15 Mar 2022 00:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647330161; cv=none; d=google.com; s=arc-20160816; b=daJmM/DY+eKktQdZ1trvpqEd0GkypZaf2GW1AeLa4koSGSzgz4cmfUprF8byb7rneQ 4yAz852pBIaiYLGLvabouuacoeXIW7yHk5y+Skzh+jI/ZOYU3MQg53I+RHraiiyCwnjW hTUuq6u1ExjfOle7rIOxn8tHR00pl+FNDTcY9hGSXr7p76T9u1NNiveoQ944YKwJrgp9 daYVazzoWD2WqqrvZiMPnrxRZihfwwssnog2uDvJNprn1/I6dhgh1E+EZ8lSoS1QkIUE /oeY7IBkEaYFiM1wwQAcWpBz7Hifo6VdOP9XzIJTaRqmBVigdADVNlDbdIN9Abf+OWXh PVzw== 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=NAstWGVulhORUEPcro29v48huPAg0z0elh+6C3bzj5S4wySF05FqFFQOUmVwKSTs4z LqHVo7wRN9cj0GkbrJk7PvuFoIoBIk56KjBTcbQnsU/iilzqRD72Yp9WpzzsNaANxz6Z 7UNNKSxOY+7H1cZuFrnLSEYpMwjqIT5p52BRd+eryFHSJ2bdu8HuTXlBvPtXIjaUwXqG 8Z5qbpBEk1oaFcKPVXVvTIy0gu9CDZuFRaID6SH+gUHwcylkJwBDypbEs3aNwphU6XXP Mzg2pj1aRkBO75NKFNnFJtpXmzG50DknNMzWifVuiVYEwgQ1IsNtpbxqHQMlYU0SVb+0 O/AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=RgjMB7dQ; 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 lm23-20020a170906981700b006df5ed0578dsi109469ejb.36.2022.03.15.00.42.17; Tue, 15 Mar 2022 00:42:41 -0700 (PDT) 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=RgjMB7dQ; 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 S233178AbiCMAXM (ORCPT + 99 others); Sat, 12 Mar 2022 19:23:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232801AbiCMAXK (ORCPT ); Sat, 12 Mar 2022 19:23:10 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19B449BBB2; Sat, 12 Mar 2022 16:22:04 -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 6542D223EF; Sun, 13 Mar 2022 01:22:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1647130922; 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=RgjMB7dQAywRjAS2CY0ReaG5nWVADe5QKwuKmAdCsTilPXYV2Qo3fcq2S2GNKfxjln2HRy 2+vjD3wPWF9lTgAfaPmDpZHz3H/JYPUVNNluQuHiOEzJqxM9VEllD9fvQlyxRpAz5SQ/MW WPBZzFDRGf0yYsHmWz5b7EFEr2wrACc= 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 2/3] net: mdio: mscc-miim: replace magic numbers for the bus reset Date: Sun, 13 Mar 2022 01:21:52 +0100 Message-Id: <20220313002153.11280-3-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220313002153.11280-1-michael@walle.cc> References: <20220313002153.11280-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