From mboxrd@z Thu Jan 1 00:00:00 1970 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 CDE6CCA0EEB for ; Tue, 12 Sep 2023 14:53:13 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qDeicLNL6SnGPEWJax7uK6RWCmBXs3HyEgttvFyR6CE=; b=nRN9yEIQzAl09D 5Bf13jelPY1YpXXJmrwbcu70A/CsGfTpRtogwQe2kEc1PSkAWFblZklg0M85MmMsaOZKSbpNtQH+I m2S1VHrdjizXCyHHdOZ+oPPUN3lbgeZYoLecGsyWDdV++EWdROCW//1sJXwFs+a0PQ0wUJReXyGhI WrfpzHI5MA08UUDspOtpGTWCUlRGRbJZCz6dfR/poE1wSKCmo8md4Hrdg4hpoVKy8hYfstO8TaSVC J5PcSiGQ3det4+0kT4LDovfeFckyxWY7hCFyVocnvLlaHoCuNoO7yj6IDjM7h81jCI8VcJz59qsOb lagaGBioET7x8rERVYeg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qg4kt-003fcb-0h; Tue, 12 Sep 2023 14:52:43 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qg4kq-003fam-0k for linux-arm-kernel@lists.infradead.org; Tue, 12 Sep 2023 14:52:41 +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 sin.source.kernel.org (Postfix) with ESMTPS id D0AFACE1934; Tue, 12 Sep 2023 14:52:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93AF7C433CD; Tue, 12 Sep 2023 14:52:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694530356; bh=Ayl+OQo2GhxKzgk/+pTD2IDT8nzvjC7bYrHEQNjKOhs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tbX5NZaZDg4omgGReZeg3XcT52zv8O95SQf5BlDQ6yAxYUCyCznrpQ8kEgx+Mh4dZ 4VyxXJD9UCo5/BbZfC1mfbdxdeuq+sCGl6v+7r9c/6+2eOKpnpxsRwHtwwzhQLPTeH 7pQhxIN1IJJ9IRyS4FzWQfCOlMswRunfMQ1jdJNVofX+gnjHeQm0lZXYGS+tvetqNB OHXficeHt+wN9/CKI/UP1ZtH7DFPH4/VCOlndcwvJx4p5vQK7ieaJ/h+EmY/HqTFHj /Q//KGi+Zh1WtjpbAncBMicQTuYW4Js/UXPTx1844+Yu96/qBFQV+PwctmZwFdaTHt 5vh4QNf4rjf9A== Date: Tue, 12 Sep 2023 16:52:27 +0200 From: Simon Horman To: "Russell King (Oracle)" Cc: Alexandre Torgue , Jose Abreu , Alexei Starovoitov , bpf@vger.kernel.org, Daniel Borkmann , "David S. Miller" , Emil Renner Berthing , Eric Dumazet , Fabio Estevam , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, Maxime Coquelin , netdev@vger.kernel.org, NXP Linux Team , Paolo Abeni , Pengutronix Kernel Team , Samin Guo , Sascha Hauer , Shawn Guo Subject: Re: [PATCH net-next 1/6] net: stmmac: add platform library Message-ID: <20230912145227.GE401982@kernel.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230912_075240_634163_37550CE7 X-CRM114-Status: GOOD ( 20.29 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Sep 11, 2023 at 04:29:11PM +0100, Russell King (Oracle) wrote: > Add a platform library of helper functions for common traits in the > platform drivers. Currently, this is setting the tx clock. > > Signed-off-by: Russell King (Oracle) Hi Russell, some minor issues raised by checkpatch follow. > --- > drivers/net/ethernet/stmicro/stmmac/Makefile | 2 +- > .../ethernet/stmicro/stmmac/stmmac_plat_lib.c | 29 +++++++++++++++++++ > .../ethernet/stmicro/stmmac/stmmac_plat_lib.h | 8 +++++ > 3 files changed, 38 insertions(+), 1 deletion(-) > create mode 100644 drivers/net/ethernet/stmicro/stmmac/stmmac_plat_lib.c > create mode 100644 drivers/net/ethernet/stmicro/stmmac/stmmac_plat_lib.h > > diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile > index 5b57aee19267..ba2cbfa0c9d1 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/Makefile > +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile > @@ -6,7 +6,7 @@ stmmac-objs:= stmmac_main.o stmmac_ethtool.o stmmac_mdio.o ring_mode.o \ > mmc_core.o stmmac_hwtstamp.o stmmac_ptp.o dwmac4_descs.o \ > dwmac4_dma.o dwmac4_lib.o dwmac4_core.o dwmac5.o hwif.o \ > stmmac_tc.o dwxgmac2_core.o dwxgmac2_dma.o dwxgmac2_descs.o \ > - stmmac_xdp.o \ > + stmmac_xdp.o stmmac_plat_lib.o \ > $(stmmac-y) > > stmmac-$(CONFIG_STMMAC_SELFTESTS) += stmmac_selftests.o > diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_plat_lib.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_plat_lib.c > new file mode 100644 > index 000000000000..abb9f512bb0e > --- /dev/null > +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_plat_lib.c > @@ -0,0 +1,29 @@ Is an SPDX identifier appropriate here? > +#include > +#include > + > +#include "stmmac_plat_lib.h" > + > +int dwmac_set_tx_clk_gmii(struct clk *tx_clk, int speed) > +{ > + unsigned long rate; > + > + switch (speed) { > + case SPEED_1000: > + rate = 125000000; > + break; > + > + case SPEED_100: > + rate = 25000000; > + break; > + > + case SPEED_10: > + rate = 2500000; > + break; > + > + default: > + return -ENOTSUPP; Checkpatch seems to think that EOPNOTSUPP would be more appropriate as "ENOTSUPP is not a SUSV4 error code". > + } > + > + return clk_set_rate(tx_clk, rate); > +} > +EXPORT_SYMBOL_GPL(dwmac_set_tx_clk_gmii); ... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel