From patchwork Thu Mar 30 15:21:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 77229 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1208742vqo; Thu, 30 Mar 2023 08:25:21 -0700 (PDT) X-Google-Smtp-Source: AKy350YNmoLtLtXVHIqzNRDV06UfiLgW1t6cx36uKPR51wM4/Qcx5KppaDKROy6NcorsHnix7S2a X-Received: by 2002:a17:906:39d6:b0:92f:48f0:736d with SMTP id i22-20020a17090639d600b0092f48f0736dmr24432311eje.62.1680189921756; Thu, 30 Mar 2023 08:25:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680189921; cv=none; d=google.com; s=arc-20160816; b=0+TGytE/3a1ueiyrJbs76Oa7KpRB2a0r5iwA6HIurczm2mvJ7glRTf/OQY+k7r0fjr ZW5imu3L9B/izAQW5pBoAUzdeFgqAdT7HFUYde6hg8usnej9aQprRRT2eceT7SmwOfe+ bqEW4FoOJqREoZKrJrm6nMDL1n+vpTGHNEyotBPf1zDD+TGkyU+M5f6PUy4DjnL9pRjx zHXjPlhpoWj6+skybL/lUlLxAzdOGLaJeyge4ZhsAYhOmfHFKG5j6dmvBu5SlXCrwpOP q2b//CcU/hemX2KV5XiSSOm6eh2RGqbaaSW6HMTIST6xYdtjDAFJXZuM82F1SEv5Ndpf T7uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=6M4B3JdBHVLAvNovtUtEy1CwwQ4IZck727Qgf1JhYW4=; b=gSUQBJ+1pkOdq3U7mG27AroxNoJX8HzOE2c7Ii/DkIoeZTBJ02ALeJY786IVKgbvSt ugtiP2zpKhSRR9Oc+BnsOua6fKUnXIDWRMeW4BBplLlX3tHmc3UIUA8TQRGZlwrt1a5B Pu9e4V/VBjhxy5jFhA7vERG/i/+6y6p2gDB4A89Etf61k2Qu7PL4TSx3a7MxX0PaRxBf eHmfp0w1WK7XLp4oDhCjrGh5qZ1YaVLaGszmiWh7cvfoG7wMpMbXGeptWWAzB0RHuOD2 rLKKwQ2zlWZBi5ls5QvKZPbiaCu4CQuV1Kwx4rbKioYz3eidbBokkP9SFGMtdwBejl1r KSmg== ARC-Authentication-Results: i=1; mx.google.com; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h3-20020a170906828300b008d6b51de6bcsi338200ejx.32.2023.03.30.08.24.56; Thu, 30 Mar 2023 08:25:21 -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; 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 S232960AbjC3PXX (ORCPT + 99 others); Thu, 30 Mar 2023 11:23:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232943AbjC3PXO (ORCPT ); Thu, 30 Mar 2023 11:23:14 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D9811710; Thu, 30 Mar 2023 08:22:42 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1phu5t-0006fB-1w; Thu, 30 Mar 2023 17:21:41 +0200 Date: Thu, 30 Mar 2023 16:21:37 +0100 From: Daniel Golle To: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, Andrew Lunn , =?utf-8?b?QXI=?= =?utf-8?b?xLFuw6cgw5xuYWw=?= , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Sean Wang , Landen Chao , DENG Qingfang , Philipp Zabel Cc: Sam Shih , Lorenzo Bianconi , John Crispin , Felix Fietkau Subject: [PATCH net-next 07/15] net: dsa: mt7530: move p5_intf_modes() function to mt7530.c Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761806826929385476?= X-GMAIL-MSGID: =?utf-8?q?1761806826929385476?= In preparation of splitting mt7530.c into a driver for MDIO-connected as well as MDIO-accessed built-in switches on one hand and MMIO-accessed built-in switches move the p5_inft_modes() function from mt7530.h to mt7530.c. The function is only needed there and will trigger a compiler warning about a defined but unused function otherwise when including mt7530.h in the to-be-introduced bus-specific drivers. Reviewed-by: Andrew Lunn Signed-off-by: Daniel Golle --- drivers/net/dsa/mt7530.c | 18 ++++++++++++++++++ drivers/net/dsa/mt7530.h | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 4fed18303673e..4993e36c2f507 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -948,6 +948,24 @@ mt7530_set_ageing_time(struct dsa_switch *ds, unsigned int msecs) return 0; } +static const char *p5_intf_modes(unsigned int p5_interface) +{ + switch (p5_interface) { + case P5_DISABLED: + return "DISABLED"; + case P5_INTF_SEL_PHY_P0: + return "PHY P0"; + case P5_INTF_SEL_PHY_P4: + return "PHY P4"; + case P5_INTF_SEL_GMAC5: + return "GMAC5"; + case P5_INTF_SEL_GMAC5_SGMII: + return "GMAC5_SGMII"; + default: + return "unknown"; + } +} + static void mt7530_setup_port5(struct dsa_switch *ds, phy_interface_t interface) { struct mt7530_priv *priv = ds->priv; diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h index 39aaca50961bd..2a611173a7d08 100644 --- a/drivers/net/dsa/mt7530.h +++ b/drivers/net/dsa/mt7530.h @@ -682,24 +682,6 @@ enum p5_interface_select { P5_INTF_SEL_GMAC5_SGMII, }; -static const char *p5_intf_modes(unsigned int p5_interface) -{ - switch (p5_interface) { - case P5_DISABLED: - return "DISABLED"; - case P5_INTF_SEL_PHY_P0: - return "PHY P0"; - case P5_INTF_SEL_PHY_P4: - return "PHY P4"; - case P5_INTF_SEL_GMAC5: - return "GMAC5"; - case P5_INTF_SEL_GMAC5_SGMII: - return "GMAC5_SGMII"; - default: - return "unknown"; - } -} - struct mt7530_priv; struct mt753x_pcs {