From nobody Sat Sep 21 03:07:47 2024 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86415C77B73 for ; Wed, 29 Mar 2023 16:00:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231329AbjC2P7j (ORCPT ); Wed, 29 Mar 2023 11:59:39 -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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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); =20 - if (priv->id =3D=3D ID_MT7531) { - ret =3D mt7531_create_sgmii(priv); - if (ret && priv->irq) - mt7530_free_irq_common(priv); - } - return ret; } =20 @@ -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; =20 dn =3D mdiodev->dev.of_node; =20 @@ -3230,6 +3225,12 @@ mt7530_probe(struct mdio_device *mdiodev) if (IS_ERR(priv->regmap)) return PTR_ERR(priv->regmap); =20 + if (priv->id =3D=3D ID_MT7531) { + ret =3D mt7531_create_sgmii(priv); + if (ret) + return ret; + } + return dsa_register_switch(priv->ds); } =20 --=20 2.39.2