From patchwork Fri Apr 21 14:36:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13220179 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 907D3C77B71 for ; Fri, 21 Apr 2023 14:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4KiBaVS3rBZL46ZkQA5szEuPGIfAQTTXY9i0okmVBlQ=; b=oT7dTLhrCrpcJi hAKLTzBv9wn8k/oBNeJpbRfJ2cs1+lL7IlyFK3P8ra81+XvVIpCXxRkLonFgBhiDZHhIVzItdNAQa vQ045wJEzbmqj85ttKygmbvJqwGRxwlt8Qdq6JRsDJeS2OPoKr6Bxie8SMSyWYPEK2P6uGd70Qfxd j9tJCW8BEOBCN1HNf6h9EEAGbVKNejedlFhWAowUc40TIyG7bju/o5CTq1uT6edRLnCMTw8sOpzgk zTkb7qI/4z1FIqYpp9SKk/aBnqeQrpMKd3/nB+TmwzfRaJzGky5PLsAU1tKUjx4oZXEOjbz6R/R7n nH10UyWL7IzGj63fC7Rg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ppruF-00B8Qh-05; Fri, 21 Apr 2023 14:38:35 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pprt2-00B7WR-26; Fri, 21 Apr 2023 14:37:22 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-94eff00bcdaso288447866b.1; Fri, 21 Apr 2023 07:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682087839; x=1684679839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4KiBaVS3rBZL46ZkQA5szEuPGIfAQTTXY9i0okmVBlQ=; b=cZ6sRw0lbJpWLND6lATpwXgJ92zCE3aNNRpTtdZph7X3D7ft5vWHRKzIV5epNP1v96 2w2xjIsERO9EJOrPXYOnzYJpPx0Ce2umfFQz/dqR2dXzeU3o0VpnEsQSO3mBP5NBzUTW 5sU6pExF59smx7ZTWZsllRvG1fDZdmYBQjacd8AmP4BkRRXqRZVBvd42XzcYoYgx4ukO pEEM7emL57SXMJyMRQs8QV/fsxXTG5yHRzaOrS3xqqHrsxqdSKhWFz91Nt975t8/XLp5 Bsfaz26iztGa7H2Ndt1FENtsndXQGRGJxXj0SQfXNvkyYNc6ML3TbldTATqINp6c9ebG 9g9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682087839; x=1684679839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4KiBaVS3rBZL46ZkQA5szEuPGIfAQTTXY9i0okmVBlQ=; b=B8FMhbhkCt44XRciEFeX+RDQ5Bswb7Un6TnmuZCgyYHNFJHBh342o7fLe3mHmg/fyc LWCJFIpHVwAOsLQCcVl80QO8tNjpwFM6C306LGQhPjdvQgpbGTtNqMj8jlzEDqRGSmd+ M5+ULnIt6QekTQCCslXJ4JmD9umWYBR09ozT6ogzA+/IkO4G15vS87CWh3YHjj+wy1BB 0KsWelxklOm4cmKIsyeasHHs4Q3/TS6fZhTrNyMoBUc/W094fqzp3kg3pR+pAtoKBu0a JTLgr7wmMam85kiILN1J+KJ9KlA/npmnLAssxP5lgiYM9NHX8kJkcUoHzRPDAfrznirZ VCfQ== X-Gm-Message-State: AAQBX9dVcDj6JrfZIAtSEiEL35aXQXqdDDdDBlAf4YgqdFkOgY3cB4hD RmPMr+UVjSr8lkYtD5pEUWM= X-Google-Smtp-Source: AKy350YK6ZXedBig5mHmtOyoPrGMFSbVmiHuPdA1NfRLq4EnkOhsj3geYQNtVkOLVZKiA/kig5Xpcg== X-Received: by 2002:a17:906:f757:b0:94e:c142:df98 with SMTP id jp23-20020a170906f75700b0094ec142df98mr2497344ejb.60.1682087839104; Fri, 21 Apr 2023 07:37:19 -0700 (PDT) Received: from arinc9-PC.lan ([149.91.1.15]) by smtp.gmail.com with ESMTPSA id q27-20020a170906361b00b0094e1026bc66sm2168244ejb.140.2023.04.21.07.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Apr 2023 07:37:18 -0700 (PDT) From: arinc9.unal@gmail.com X-Google-Original-From: arinc.unal@arinc9.com To: Sean Wang , Landen Chao , DENG Qingfang , Daniel Golle , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King Subject: [RFC PATCH net-next 11/22] net: dsa: mt7530: remove pad_setup function pointer Date: Fri, 21 Apr 2023 17:36:37 +0300 Message-Id: <20230421143648.87889-12-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230421143648.87889-1-arinc.unal@arinc9.com> References: <20230421143648.87889-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230421_073720_724727_C5567AA4 X-CRM114-Status: GOOD ( 17.68 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Richard van Schagen , linux-kernel@vger.kernel.org, Richard van Schagen , =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= , linux-mediatek@lists.infradead.org, erkin.bozoglu@xeront.com, linux-arm-kernel@lists.infradead.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Arınç ÜNAL The pad_setup function pointer was introduced with 88bdef8be9f6 ("net: dsa: mt7530: Extend device data ready for adding a new hardware"). It was being used to set up the core clock and port 6 of the MT7530 switch, and pll of the MT7531 switch. All of these were moved to more appropriate locations, and it was never used for the switch on the MT7988 SoC. Therefore, this function pointer hasn't got a use anymore. Remove it. Tested-by: Arınç ÜNAL Signed-off-by: Arınç ÜNAL Acked-by: Daniel Golle --- drivers/net/dsa/mt7530.c | 36 ++---------------------------------- drivers/net/dsa/mt7530.h | 3 --- 2 files changed, 2 insertions(+), 37 deletions(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 58eff6568d4c..a1627e20675d 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -473,18 +473,6 @@ mt7530_setup_port6(struct dsa_switch *ds, phy_interface_t interface) return 0; } -static int -mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface) -{ - return 0; -} - -static int -mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface) -{ - return 0; -} - static void mt7531_pll_setup(struct mt7530_priv *priv) { @@ -2569,14 +2557,6 @@ static void mt7988_mac_port_get_caps(struct dsa_switch *ds, int port, } } -static int -mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state) -{ - struct mt7530_priv *priv = ds->priv; - - return priv->info->pad_setup(ds, state->interface); -} - static int mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode, phy_interface_t interface) @@ -2743,8 +2723,6 @@ mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, if (priv->p6_configured) break; - mt753x_pad_setup(ds, state); - if (mt753x_mac_config(ds, port, mode, state) < 0) goto unsupported; break; @@ -3046,11 +3024,6 @@ static int mt753x_set_mac_eee(struct dsa_switch *ds, int port, return 0; } -static int mt7988_pad_setup(struct dsa_switch *ds, phy_interface_t interface) -{ - return 0; -} - static int mt7988_setup(struct dsa_switch *ds) { struct mt7530_priv *priv = ds->priv; @@ -3112,7 +3085,6 @@ const struct mt753x_info mt753x_table[] = { .phy_write_c22 = mt7530_phy_write_c22, .phy_read_c45 = mt7530_phy_read_c45, .phy_write_c45 = mt7530_phy_write_c45, - .pad_setup = mt7530_pad_clk_setup, .mac_port_get_caps = mt7530_mac_port_get_caps, .mac_port_config = mt7530_mac_config, }, @@ -3124,7 +3096,6 @@ const struct mt753x_info mt753x_table[] = { .phy_write_c22 = mt7530_phy_write_c22, .phy_read_c45 = mt7530_phy_read_c45, .phy_write_c45 = mt7530_phy_write_c45, - .pad_setup = mt7530_pad_clk_setup, .mac_port_get_caps = mt7530_mac_port_get_caps, .mac_port_config = mt7530_mac_config, }, @@ -3136,7 +3107,6 @@ const struct mt753x_info mt753x_table[] = { .phy_write_c22 = mt7531_ind_c22_phy_write, .phy_read_c45 = mt7531_ind_c45_phy_read, .phy_write_c45 = mt7531_ind_c45_phy_write, - .pad_setup = mt7531_pad_setup, .cpu_port_config = mt7531_cpu_port_config, .mac_port_get_caps = mt7531_mac_port_get_caps, .mac_port_config = mt7531_mac_config, @@ -3149,7 +3119,6 @@ const struct mt753x_info mt753x_table[] = { .phy_write_c22 = mt7531_ind_c22_phy_write, .phy_read_c45 = mt7531_ind_c45_phy_read, .phy_write_c45 = mt7531_ind_c45_phy_write, - .pad_setup = mt7988_pad_setup, .cpu_port_config = mt7988_cpu_port_config, .mac_port_get_caps = mt7988_mac_port_get_caps, .mac_port_config = mt7988_mac_config, @@ -3179,9 +3148,8 @@ mt7530_probe_common(struct mt7530_priv *priv) /* Sanity check if these required device operations are filled * properly. */ - if (!priv->info->sw_setup || !priv->info->pad_setup || - !priv->info->phy_read_c22 || !priv->info->phy_write_c22 || - !priv->info->mac_port_get_caps || + if (!priv->info->sw_setup || !priv->info->phy_read_c22 || + !priv->info->phy_write_c22 || !priv->info->mac_port_get_caps || !priv->info->mac_port_config) return -EINVAL; diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h index c3a37a0f4843..cad9115de22b 100644 --- a/drivers/net/dsa/mt7530.h +++ b/drivers/net/dsa/mt7530.h @@ -696,8 +696,6 @@ struct mt753x_pcs { * @phy_write_c22: Holding the way writing PHY port using C22 * @phy_read_c45: Holding the way reading PHY port using C45 * @phy_write_c45: Holding the way writing PHY port using C45 - * @pad_setup: Holding the way setting up the bus pad for a certain - * MAC port * @phy_mode_supported: Check if the PHY type is being supported on a certain * port * @mac_port_validate: Holding the way to set addition validate type for a @@ -718,7 +716,6 @@ struct mt753x_info { int regnum); int (*phy_write_c45)(struct mt7530_priv *priv, int port, int devad, int regnum, u16 val); - int (*pad_setup)(struct dsa_switch *ds, phy_interface_t interface); int (*cpu_port_config)(struct dsa_switch *ds, int port); void (*mac_port_get_caps)(struct dsa_switch *ds, int port, struct phylink_config *config);