From patchwork Wed Mar 29 15:58:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 76690 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp519688vqo; Wed, 29 Mar 2023 09:03:14 -0700 (PDT) X-Google-Smtp-Source: AKy350ZS+LtDh6PLAyr638PCguubSBahzZ8zw9RsqOTCNJKWSVpo0B6K1nqC4F+4AejT5G8ynFeS X-Received: by 2002:a17:906:2759:b0:930:8fd7:789f with SMTP id a25-20020a170906275900b009308fd7789fmr18077370ejd.38.1680105794461; Wed, 29 Mar 2023 09:03:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680105794; cv=none; d=google.com; s=arc-20160816; b=M3+kURi3QrfJu51LU1G6nspbPcQkcZHxuk7RcEwL0SGtEbY5ycPm2lztvYyySSaZER UTnj+rGrA2Vwo6S+cA8AaFuyMdpVTk/STI9l+QoLRIdm/5rf5b9v5E3GqWVpem643Qf7 DNeZEXLaT4uyG7KWwxLAbIqesBwfzF7NMYJQ+ouoLTjgEoriE9f/quTk7LMPW0xVUrGc PUSnRwt3hYzeAsPAbT6ScUXXnUgYG9ha+Q9cuD/k222AmAsI74ZLI+xSzAhMRK6+KpzB ve+0ST1DkNGtmTEPN8ePVPkVJfFTapoodFYV4V6rralR8EmjKZReBslX1mJ6vGsPko7v UBCg== 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=X/vg3LHJEYX8njHmHR1XRnTW1s07I4OfY1UbowpGtCQ=; b=o6H5o99oKe5hj0a03hCXqY8QuWYv/YX0SWmzdcTQQI5BmiIlUd2XmdyqaEMvLzrCg0 w2n6rKYkDZ2d1y2f+3OsLE98GATL5g6pHu+HVnayJ2D37my5FOVjyEBGnrYnv5iNDKvs 3ino9W2WTAoQv+KIzr6vkm2WkJqER8ecIpvTIaKsoI2yMhaMnE+HD5P56MpimTxCP5nJ cEf67VQGJxDNlUpt01pOCFR1tGc5UP1isxTZR1HjsCPGtAEjPSTrEEbwABjboDmgbTmf iiP4KQD3qyZS2MikpnEarkyzvJVRmvGLJn+gXJMEwp4OwBZ1zngohWcv0qbAo5cKOlr2 knsg== 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 sg13-20020a170907a40d00b009334637f8a5si34206901ejc.125.2023.03.29.09.02.45; Wed, 29 Mar 2023 09:03:14 -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 S229983AbjC2QAK (ORCPT + 99 others); Wed, 29 Mar 2023 12:00:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231437AbjC2P7R (ORCPT ); Wed, 29 Mar 2023 11:59:17 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D017059E7; Wed, 29 Mar 2023 08:58: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 1phYC7-0003Ne-1w; Wed, 29 Mar 2023 17:58:40 +0200 Date: Wed, 29 Mar 2023 16:58:35 +0100 From: Daniel Golle To: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Lunn , 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: [RFC PATCH net-next v3 06/15] net: dsa: mt7530: move p5_intf_modes() function to mt7530.c Message-ID: <98fc2eec00985854010e3d0d16ba7f4c924ab49f.1680105013.git.daniel@makrotopia.org> 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?1761718613297212901?= X-GMAIL-MSGID: =?utf-8?q?1761718613297212901?= 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. Signed-off-by: Daniel Golle Reviewed-by: Andrew Lunn --- 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 033e70b42b12a..221d56cf9e710 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -946,6 +946,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 {