Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp832335rwl; Wed, 29 Mar 2023 09:02:43 -0700 (PDT) X-Google-Smtp-Source: AKy350aTKUBBDXcg8QVz7rpIPMa+pfqRHDxJEAW262K82noyFxWjHBTLwPoW7CbnRVjWPSCJUoi2 X-Received: by 2002:a17:906:6542:b0:925:8bc0:b19 with SMTP id u2-20020a170906654200b009258bc00b19mr2833883ejn.20.1680105763639; Wed, 29 Mar 2023 09:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680105763; cv=none; d=google.com; s=arc-20160816; b=CLNO7QXX37iXRt8Bm5YqkZ4gc9+MXkDKUjF3m2R8GYUi6RESm6KJoyngjg7zEBj+Sv ZoxXunPwaiipNI3CvSuOJ/Gs/wkdzhzxMKQMdJTWaocPqYya3tLw1QPq+ziviv+J48ml 47Lok1OcomMEcC1YRsvl1aIFbYd3jG0Z70u2dxfET6OpNz4WamrByJ0gxYkGLZWXUJsK V/uUwYBwALEvHFWUyxfBll3EkaQz36KL8T7WUma/yHmD6q9YrEIaUAKU4rsbBKQ6uL99 3Px44aYfdZtsc/TiWOEBUeUQK1h7T0scwwEwA3IKiz69RqKjy/zFtad3A29uAXLUg3XL PCHw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp41-20020a1709073e2900b0093defbd628esi17263561ejc.1045.2023.03.29.09.02.15; Wed, 29 Mar 2023 09:02:43 -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 S231307AbjC2P7i (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-Type: text/plain; charset=us-ascii 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 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); } -- 2.39.2