From patchwork Mon Apr 3 01:18: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: 78320 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1999598vqo; Sun, 2 Apr 2023 18:20:21 -0700 (PDT) X-Google-Smtp-Source: AKy350a8zXedZAVy948jukBn7dkEzryt9MiHnwf7Bje6MUXxTWMMNBXiCLCxvJm8Ls3QT6HTYoEt X-Received: by 2002:a17:90b:1e4a:b0:23f:3f9c:7878 with SMTP id pi10-20020a17090b1e4a00b0023f3f9c7878mr37536289pjb.2.1680484821518; Sun, 02 Apr 2023 18:20:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680484821; cv=none; d=google.com; s=arc-20160816; b=GwCW2SJftSyPqv2VStGt718hgQKThR4xE9TLWpwmj96tC0ZhG/gFcJHm8VbNAXT1dS mDXWYWZvTTiTwe4CcsXSKegJwAEvjjSWptVk3iQux6DRBGcrKWXqkurBzajtT6DTTGhO b7fj4dSKENTn5kIRfIBqh3g4xk9C/K97UbUB+f7M4yck3+Hgb/l9KPoyLAOrU6DdJId4 D3mKpoRNRVHHzuOJnhkUTdcU23PXVvmESpZ+2RsRTt+4eEEjLZmwLa1HfTN9M924nSXc 4yXSHlgfsy1nX8cRPaT/jyprLbvvPUZZGZ+d59eg+q2eCtq6XS/cG12PZqHR1vAXcjNI KRWQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kj14-20020a17090306ce00b001a124b3b348si6943275plb.172.2023.04.02.18.20.09; Sun, 02 Apr 2023 18:20:21 -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 S230488AbjDCBSa (ORCPT + 99 others); Sun, 2 Apr 2023 21:18:30 -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-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?1762116051713170569?= X-GMAIL-MSGID: =?utf-8?q?1762116051713170569?= 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); }