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: 13367285 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2CA14C83F01 for ; Sun, 27 Aug 2023 13:54:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cg09cnfm2k4y1ZsC7lc34ip1AltWO9phMYs/dwSQfmw=; b=LTbbGUOvJiuWUn nbmN7Bz1neFQueon5eKwsVJZ1zop/2J5SjjrWUzWxkXeMjTIfnSm8Bs4U9xWRqnElU6Jx2rjWnuXp Q4iSOBxBInJgXfEqQpam9UAxKZPUPLm746fynvAm9TFfbvEeKq/5vM8McfvXVuvgZT8Wht9LZUMj4 TLSK5ZWuiMEuEx0qnL5PZQ7BXuWEIwNIeXgs1kCFWCXa0ji0++8jQ2ooN7j7B6c/mO4ao2bTYZyb8 Kpg0n5KruCzAhe2bP3nLislmZ0nT3QrlvdVrtbIEDpfFd3HCEM9PuBETN1ljQ8Ym43zu3UlNzFz3j lJt+x7k909RrrK+3tsig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qaGDT-00886A-1T; Sun, 27 Aug 2023 13:54:11 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qaGDE-008815-1F for linux-arm-kernel@lists.infradead.org; Sun, 27 Aug 2023 13:53:57 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D767262BD9; 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230827_065356_470327_7E72780C X-CRM114-Status: GOOD ( 10.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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);