From patchwork Sun Aug 27 13:41:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13367282 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8107610945 for ; Sun, 27 Aug 2023 13:53:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87EFAC433CB; Sun, 27 Aug 2023 13:53:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693144435; bh=Kr78mWGRf6MBDQoDlE1Lr7eQQGJaKlhNBXFLknzw88E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C7vmYP/FTlRo1iYOX8JaWg3RpiLfbWcc9THwvP5MyglGp/uzIsXymKqNF+fpKxm04 zo6hBgBwaq718v9Z4/9Zm0nqRgWr9S+lbD+C+yGAQCjH7uFda/RUm1sDTJLLDepUeY w03vlgFGfE6epFLES3kwrH0haVsSwlF5zcBtC7ROqx1yeEOXzUxhc48b01H0/hzZfB 9ktrd0wdZseXfGo2Z39S1+8Z4NRKxRimxKmWW2nJxgAmxcQy25S+MidFIQRa8DrbwT 2kmo57GpHGbLueVXJMUal/jtTGcyrdVvGYZfHrCdhbro5oBNIiNVwSdvfzDCCGvgkA SwhQjXvaMXnig== From: Jisheng Zhang To: Emil Renner Berthing , Samin Guo , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/2] net: stmmac: dwmac-starfive: remove unnecessary clk_get_rate() Date: Sun, 27 Aug 2023 21:41:50 +0800 Message-Id: <20230827134150.2918-3-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230827134150.2918-1-jszhang@kernel.org> References: <20230827134150.2918-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org In starfive_dwmac_fix_mac_speed(), the rate gotten by clk_get_rate() is not necessary, remove the clk_get_rate() calling. Signed-off-by: Jisheng Zhang Reviewed-by: Emil Renner Berthing --- drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c index b68f42795eaa..422138ef565e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-starfive.c @@ -30,8 +30,6 @@ static void starfive_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigne unsigned long rate; int err; - rate = clk_get_rate(dwmac->clk_tx); - switch (speed) { case SPEED_1000: rate = 125000000; @@ -44,7 +42,7 @@ static void starfive_dwmac_fix_mac_speed(void *priv, unsigned int speed, unsigne break; default: dev_err(dwmac->dev, "invalid speed %u\n", speed); - break; + return; } err = clk_set_rate(dwmac->clk_tx, rate);