From patchwork Wed Mar 29 15:58:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 76701 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp536005vqo; Wed, 29 Mar 2023 09:25:09 -0700 (PDT) X-Google-Smtp-Source: AKy350al2PUyWA7uRJ/zk770X70RZgmuwcUaYmXgsWZQDI/D+0GLMvsyDprBBPX1jRIcwSAM/zC+ X-Received: by 2002:a05:6a20:4c82:b0:e1:204e:ddd6 with SMTP id fq2-20020a056a204c8200b000e1204eddd6mr5353011pzb.6.1680107109199; Wed, 29 Mar 2023 09:25:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680107109; cv=none; d=google.com; s=arc-20160816; b=NxIq0V79XeW7vuW6UazxvX5VFeIDiuE4QRboahCO6JIkkvrY85mgZzTXl4Un12+ehh Ff/j8VDXFATX8lFSK1uJBuEMfTRJ/hZkNs0qJyN0W8ymTn9Zs2eS6UPjYJXLHEykxobL wehmaW6pZlBHy5Vx90vB+e1zPhxt3Kg5SDV5PinQ7To/bKIoVhoK5B4LOqDUN5Xli67k e6nnVEZoa+qwbjDSyem8UL/Xl9juI+t3L+fuM4oPd6KNB54eR9bZbvGGcsSO00RLPcmp C8/R60VU6ZzudnJbomuo6pIExGjZfeB0b+LGNtxWbT2gGdGX3sSkc8CqqRTkiGRAkwVZ cunw== 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=gyBXOXVoCKA+b3WVcwiOCaoLDwhqDfZdCqHh5F/s6MA=; b=bBSyfqGj7LjmBNCb0svJRA1t2u1Tuj/g0XAOFeiEBmb7E1pWESmyn9OeJSE9xqtG0d AwpRmJkS1BDXNKzoydXSstzcQztgX/WreDp9oMP07JEcKxr8ro2dOQ/G7WM8ani5R+XI MmikG+pmo2bzmCkiTIVA/BgfNG7Ado5TtvcGX47MjGA4g8HI9wRphDkJUyq282705Ir2 u4kAH8wA7uZENHmkc8uI/PFKmNCrYeMr7PIz2gmtk746Biuk/x526Ztm7QMM7dxEjIj9 qp+ZDfkpVVeTmOfwnNGtrj9oFqU6Penm83YbrN+xBQ6ejWyKWMqn41yswN75WgTYjnl/ vYhg== 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 bd9-20020a056a00278900b00625683e6d41si32570460pfb.343.2023.03.29.09.24.55; Wed, 29 Mar 2023 09:25:09 -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 S231311AbjC2P7i (ORCPT + 99 others); Wed, 29 Mar 2023 11:59:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbjC2P6r (ORCPT ); Wed, 29 Mar 2023 11:58:47 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9750865A9; Wed, 29 Mar 2023 08:58:25 -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 1phYBc-0003MM-1u; Wed, 29 Mar 2023 17:58:09 +0200 Date: Wed, 29 Mar 2023 16:58:04 +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 04/15] net: dsa: mt7530: move SGMII PCS creation to mt7530_probe function 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?1761719992096208104?= X-GMAIL-MSGID: =?utf-8?q?1761719992096208104?= Move creating the SGMII PCS from mt753x_setup() to the more appropriate mt7530_probe() function. This is done also in preparation of moving all functions related to MDIO-connected MT753x switches to a separate module. Signed-off-by: Daniel Golle --- drivers/net/dsa/mt7530.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index fffeac8d34855..42c89d4863cd5 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -3010,12 +3010,6 @@ mt753x_setup(struct dsa_switch *ds) if (ret && priv->irq) mt7530_free_irq_common(priv); - if (priv->id == ID_MT7531) { - ret = mt7531_create_sgmii(priv); - if (ret && priv->irq) - mt7530_free_irq_common(priv); - } - return ret; } @@ -3138,6 +3132,7 @@ mt7530_probe(struct mdio_device *mdiodev) static struct regmap_config *regmap_config; struct mt7530_priv *priv; struct device_node *dn; + int ret; dn = mdiodev->dev.of_node; @@ -3230,6 +3225,12 @@ mt7530_probe(struct mdio_device *mdiodev) if (IS_ERR(priv->regmap)) return PTR_ERR(priv->regmap); + if (priv->id == ID_MT7531) { + ret = mt7531_create_sgmii(priv); + if (ret) + return ret; + } + return dsa_register_switch(priv->ds); }