From patchwork Wed Jun 21 18:25:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13287866 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 3D0821B910 for ; Wed, 21 Jun 2023 18:26:20 +0000 (UTC) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 421DC1739 for ; Wed, 21 Jun 2023 11:26:18 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-3110a5f2832so5946116f8f.1 for ; Wed, 21 Jun 2023 11:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1687371976; x=1689963976; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LzNmZCXlSWOYlmr4PSAR1znItM6ZQApvKlAxUdPBEws=; b=lhB4O4R+QgPqC82mKzgnaE06t2sQ47iDhSESMJWL1zy6rkjIOJWFo5+Gwh6GhWI+uz ey65qccVH09imlh0PF+C414coaq8d9BYz6AGcWp+N1TjTa527238y6siI9gidbDAeCDU 76zOQT5G9rsHAIoAkaGK9dcjoG8hZTytnrA2W4ANsAAHwDkNGjkdecHfvL4ZQMlhU19k 1Amyr57UncHC2/RYS3R31PHdyz3pgXXYZbKG+kkOvYDCysRw6TqqPSl2OFHKmQs8I75+ DmuchEoqtEMw9cVFWpn2neqSd0vqINszD70ESXoz5UALEbRcehho/0PpCMbvdpjZEcX2 AiUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687371976; x=1689963976; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LzNmZCXlSWOYlmr4PSAR1znItM6ZQApvKlAxUdPBEws=; b=kttgI2QM/lr0jn3Q7L3HWuQKt/Vn/u7q+3Terla77brcQQ90/bVzSKmQeD393BTtHD dILTeXUBsbfmnoSM1885O5D8ez4v/NLazPyV6x6hMICN8y+mwXaKvt88FnmLLNmLGAls Ps3cZfDy2r2whCOlHuAB+UKvl4cPkRn1IJG4wXvY3abcMPSPpV2dHvI+s7pZcUurXDJs Fkqg8H+cSCY7ASksQ3FFkwv7LnEZVPjSdKcUml3YItOAXUrFZYZ9VBBdID5+zPVYYsMq JvwZ6536LB4QfxCFRzjDyQnXVLFN2d8ehRajE/U5pnvCXJ0iTe1KTzZVM1oiXVgKq2ZD gkrw== X-Gm-Message-State: AC+VfDxxeZ6qJQTYaNJVHa5SAmYV4KrRGxFt4ge9Jy9xKj9Q6NpO5VS5 CDxiZqqupXvFUOwqjMyIWXtByQ== X-Google-Smtp-Source: ACHHUZ4HCkDRLe8HCWmsjiSHsLkUzqg1IZqv9rJNe6nBf1jtTA0Q2s1/Z9TWBYU3unjBDb78RiLtCg== X-Received: by 2002:a5d:620e:0:b0:30f:c050:88dd with SMTP id y14-20020a5d620e000000b0030fc05088ddmr18903240wru.8.1687371976794; Wed, 21 Jun 2023 11:26:16 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:334:ac00:a69f:8ee3:6907:ccdf]) by smtp.gmail.com with ESMTPSA id z13-20020adff74d000000b0030af15d7e41sm5176994wrp.4.2023.06.21.11.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 11:26:16 -0700 (PDT) From: Bartosz Golaszewski To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Vinod Koul , Bhupesh Sharma , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Thierry Reding , Jonathan Hunter , Richard Cochran , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH net-next 04/12] net: stmmac: replace the has_sun8i field with a flag Date: Wed, 21 Jun 2023 20:25:50 +0200 Message-Id: <20230621182558.544417-5-brgl@bgdev.pl> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230621182558.544417-1-brgl@bgdev.pl> References: <20230621182558.544417-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Bartosz Golaszewski Drop the boolean field of the plat_stmmacenet_data structure in favor of a simple bitfield flag. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- include/linux/stmmac.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c index 1e714380d125..2b5ebb15bfda 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c @@ -1227,7 +1227,7 @@ static int sun8i_dwmac_probe(struct platform_device *pdev) plat_dat->interface = interface; plat_dat->rx_coe = STMMAC_RX_COE_TYPE2; plat_dat->tx_coe = 1; - plat_dat->has_sun8i = true; + plat_dat->flags |= STMMAC_FLAG_HAS_SUN8I; plat_dat->bsp_priv = gmac; plat_dat->init = sun8i_dwmac_init; plat_dat->exit = sun8i_dwmac_exit; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index a1a59af3961d..3df32658b5bb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -325,7 +325,7 @@ static void stmmac_clk_csr_set(struct stmmac_priv *priv) priv->clk_csr = STMMAC_CSR_250_300M; } - if (priv->plat->has_sun8i) { + if (priv->plat->flags & STMMAC_FLAG_HAS_SUN8I) { if (clk_rate > 160000000) priv->clk_csr = 0x03; else if (clk_rate > 80000000) @@ -6856,7 +6856,7 @@ static int stmmac_hw_init(struct stmmac_priv *priv) int ret; /* dwmac-sun8i only work in chain mode */ - if (priv->plat->has_sun8i) + if (priv->plat->flags & STMMAC_FLAG_HAS_SUN8I) chain_mode = 1; priv->chain_mode = chain_mode; diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 15fb07cc89c8..66dcf84d024a 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -207,6 +207,7 @@ struct dwmac4_addrs { #define STMMAC_FLAG_HAS_INTEGRATED_PCS BIT(0) #define STMMAC_FLAG_SPH_DISABLE BIT(1) #define STMMAC_FLAG_USE_PHY_WOL BIT(2) +#define STMMAC_FLAG_HAS_SUN8I BIT(3) struct plat_stmmacenet_data { int bus_id; @@ -270,7 +271,6 @@ struct plat_stmmacenet_data { struct reset_control *stmmac_ahb_rst; struct stmmac_axi *axi; int has_gmac4; - bool has_sun8i; bool tso_en; int rss_en; int mac_port_sel_speed;