Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1150650rdb; Sat, 18 Nov 2023 05:14:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHy8cbsnYIx8SSvXSwx/fSnKkDvM7rCZiEM5IDJQJuOkvLZzWDUZJP48XiKNI0RXzN8j7Rd X-Received: by 2002:a9d:6c4a:0:b0:6bf:1e78:cc52 with SMTP id g10-20020a9d6c4a000000b006bf1e78cc52mr2445595otq.25.1700313286160; Sat, 18 Nov 2023 05:14:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700313286; cv=none; d=google.com; s=arc-20160816; b=MVAsCfLuJfhvxUPCyRVI4+Pronk7KO4tsNoJvOrHgCiR/NgAcCpXo6iZ+exz+CoJLD cblH3yeEuTj9ICpQsulAvf+kGbX32dmFJi0yL+TEZH+Fpro+K4UkM0re8BewiiG2xe9c PzXoZo/SPRcfNv5WqnBup6CnwMwp5aDpxkZUb9M3oSFxElHUC/5Sr5//GtWwiaJdavvK 5Q7PJycaLwBACSzwfc1loQnbhshra5GMX4AmnXYS1L1z7zRV/vKaD6It0oUM2zvDBL04 cxS/xKf9G3gpRhQKTC2P071IxU6yCPosxGmGe0flyR49op1FlIUEGPDC61x+r7gWS8x1 PjwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uXFYiw10a0pMRlEC7kyG2G0OwntK950CTsvbCBCBf30=; fh=pxvM+Wf6tCsucgcJlpaT+KtPH3mT2/1sv0nByOcyBzY=; b=AliVs2gOCUT4L5C1VxY8b1P03xKn7Sb0SCtgl1id4IP+dfx2909GagMNCl/W3gWC2V IPurektn6I09cBCzz6opX4XSdnoPSIlK3e4EkxAvTfmuEE0lwJKIaK6liJ4qmq4PMbtM sQF4qxnLqIeMRaZ9m4tAp7V7en1DKcHlHmzyMZmmbuQ2zRYqwEsGUZeOlGIoFuzB9SHZ fn65RnefN//P0xrpf2zE2voPFQhW+9XR00WOeK9LIZWo+ZNkRbamTVDPjxqlqh1LV9mR dvGKFE1XjC+XWHLeSE63E4XXhDCRI0lh0lTyAofxBRHNsQlT/kdaep7x8EzrLYD48a5w jCRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=PWZl8nw7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id r185-20020a632bc2000000b005a9c40151b3si4332682pgr.804.2023.11.18.05.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 05:14:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b=PWZl8nw7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id DCBCF8048C2D; Sat, 18 Nov 2023 05:14:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229670AbjKRNOe (ORCPT + 99 others); Sat, 18 Nov 2023 08:14:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjKRNOe (ORCPT ); Sat, 18 Nov 2023 08:14:34 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D45EF127; Sat, 18 Nov 2023 05:14:29 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3ABCD20003; Sat, 18 Nov 2023 13:14:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1700313268; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uXFYiw10a0pMRlEC7kyG2G0OwntK950CTsvbCBCBf30=; b=PWZl8nw7sn+4XH1/1AYHk3tWRGYSS8MU9Q/LVr3grMOWXGARHkH7VDsDb7/NYYewaBi6J5 cra7ROM6eNlyxIzZu5NSD00nRRDnpvTuRe8u2i6S0Xdd/OuUfvMT1GIrNsmcPo5C68F1xy /pN4u2MDFW48jiy6VYJMl/fHiZew8w0WWLoyTUy9wHLc4Vkejcw8tRNpbxaWqQ5WRq7PPc G4ESZvCcRE2biC2hHrxVa9RAXDEMqMWYbmwCO+ZGlkvIa4klNg5vZ5wJKMUcM/2h3FGhz3 zWfXxPCdlc2a5iwAgshoJBaBllTDXSdGIbn+jnzAC9ITgwjel57AZSv6IwmmPg== From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= To: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Frank Wunderlich , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com Subject: [PATCH net-next 11/15] net: dsa: mt7530: move XTAL check to mt7530_setup() Date: Sat, 18 Nov 2023 16:13:13 +0300 Message-Id: <20231118131317.295591-1-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231118123205.266819-1-arinc.unal@arinc9.com> References: <20231118123205.266819-1-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: arinc.unal@arinc9.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 18 Nov 2023 05:14:44 -0800 (PST) The crystal frequency concerns the switch core. The frequency should be checked when the switch is being set up so the driver can reject the unsupported hardware earlier and without requiring port 6 to be used. Move it to mt7530_setup(). Drop the unnecessary function printing. Signed-off-by: Arınç ÜNAL Reviewed-by: Andrew Lunn --- drivers/net/dsa/mt7530.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index efe5ffe3455d..167b340350b3 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -422,13 +422,6 @@ mt7530_setup_port6(struct dsa_switch *ds, phy_interface_t interface) xtal = mt7530_read(priv, MT7530_MHWTRAP) & HWTRAP_XTAL_MASK; - if (xtal == HWTRAP_XTAL_20MHZ) { - dev_err(priv->dev, - "%s: MT7530 with a 20MHz XTAL is not supported!\n", - __func__); - return -EINVAL; - } - switch (interface) { case PHY_INTERFACE_MODE_RGMII: trgint = 0; @@ -2235,6 +2228,12 @@ mt7530_setup(struct dsa_switch *ds) return -ENODEV; } + if ((val & HWTRAP_XTAL_MASK) == HWTRAP_XTAL_20MHZ) { + dev_err(priv->dev, + "MT7530 with a 20MHz XTAL is not supported!\n"); + return -EINVAL; + } + /* Reset the switch through internal reset */ mt7530_write(priv, MT7530_SYS_CTRL, SYS_CTRL_PHY_RST | SYS_CTRL_SW_RST | -- 2.40.1