Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3899893rwl; Sun, 2 Apr 2023 18:19:03 -0700 (PDT) X-Google-Smtp-Source: AK7set8mVj/8uWJFKULXUUBaJo4bxt/Da5MAurfWCfhuI8QQsR3Kcuo95bJdtkRDgTX4Bfr4zAZY X-Received: by 2002:a17:903:32c1:b0:1a1:f70c:c81a with SMTP id i1-20020a17090332c100b001a1f70cc81amr45395300plr.9.1680484742986; Sun, 02 Apr 2023 18:19:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680484742; cv=none; d=google.com; s=arc-20160816; b=SU4wiu6klsu81RQATh0x8WyWcpPm/hCMDl7BvHAVzy4oYMUyrnpQMku8LH35/veg6O ARmHm5w/sR/qBEMrgTnUoP5ez/402tvAbwJ2/RQ4wZkdLGntLsLMU5z1KGbzERbWRJLV 2b7iIN2u+Uxyv8WSJQj+vwrr+jha8omr/5/PbCHWIh397x74Z5mkg8bMC/ilDtHeKrjd jBX+7bqKOfq4lqx2uLSeX0LpOoeS4MyDy9KkTwp0Cil95ZycFUyOtSh64xW3y/3/knca 8sERKgMdz1xLxPnjtpolf2jCyT/k3pUb52jH2znqh3kgLpLmp8sxGIYrQAktq+o5HWA7 82Ig== 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=8zi0gFsiHbY/GtdaTGX5dmhw/IXTGaARY+af6bqSj44=; b=SjrFkX8qpDIivgzaXTjrmKQ39Pgp25BTFrGgrNzRNKQSXk0DJ+UMeA59T93hqh2MrY LUJf7dL37AjHeDyjG5lEBoJ9kZLGXp+3kA6hh2k/fu4Co2rzi7x+Ftm3Sb43nB2+cSJi nXokFJnhxgex/AZbf90bh4MB/P57K9uLiL6WgKYheazo08LxTKH1KJEFsfYQw8MKVLBo diGYUOG3RJOBk/qCz+nsPzKkuTVfTI6zmLyd0+7Ly8E8dPgWn7SlwgzKCtsck6+d+bLa 9MjVzMTfd+WrIGOGxQOetbDUV040W1glxYJXtyWSgR7O0rz4nF6Jv80ZzdcHXb2vVdpm IOHA== 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 123-20020a630681000000b0051367d9cf70si7691415pgg.93.2023.04.02.18.18.52; Sun, 02 Apr 2023 18:19:02 -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 S231189AbjDCBS3 (ORCPT + 99 others); Sun, 2 Apr 2023 21:18:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231128AbjDCBS2 (ORCPT ); Sun, 2 Apr 2023 21:18:28 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02BE5BDD9; Sun, 2 Apr 2023 18:18:09 -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 1pj8pk-0004ie-0n; Mon, 03 Apr 2023 03:18:08 +0200 Date: Mon, 3 Apr 2023 02:18: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 , Russell King , =?utf-8?B?QXLEsW7DpyDDnG5hbA==?= Cc: Sam Shih , Lorenzo Bianconi , John Crispin , Felix Fietkau Subject: [PATCH net-next v2 05/14] 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 Reviewed-by: Andrew Lunn --- 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 a0e1e2e015f0b..d285a60aaf684 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -3008,12 +3008,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; } @@ -3136,6 +3130,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; @@ -3228,6 +3223,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.40.0