From patchwork Fri Mar 18 14:50:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1607106 X-Patchwork-Delegate: rfried.dev@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=B/jE/5cy; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KKn6v6XGsz9s3q for ; Sat, 19 Mar 2022 01:52:39 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B540983F69; Fri, 18 Mar 2022 15:51:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="B/jE/5cy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ABF9183D65; Fri, 18 Mar 2022 15:51:00 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8E32B81CFC for ; Fri, 18 Mar 2022 15:50:56 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 67ACA61AEC; Fri, 18 Mar 2022 14:50:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA433C340EC; Fri, 18 Mar 2022 14:50:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647615054; bh=Gkitg/h1pYkY3ICBlmYBr9eVyPc1X7EBfKOAaHiKT2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B/jE/5cyKom3DrT2FGIKfJdIzX0gxHDG1RWCVfTtOpdvO67P9kk496K3GVMiKoaj1 n2wEYFEJr0ktRKM4GuBzizhfm8cgEEewNNYzGXmSeunIibXlX5jJPXx5eTp2h1J1Rf hSA9B0VmUUJEAETNYtRIGO0+O+6BPjR1I1aoBXBSbpYpXyFziNBVLMCNty68L40OPa NDW2TZN2Lqce8A7i3I+Psh+MHPTykC/pH53kc24LUSVl86wJOQmlG9vPFSmblBNOtw gb//cd937b5yMr4MmzhlK+KIKXOUMq0T/Yl9iWMdpCb2OF8BZEH1gNSaAgae060UyG jRmTRaVDsq7MA== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Joe Hershberger , Ramon Fried Cc: u-boot@lists.denx.de, =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-net v2 11/14] net: phy: xilinx: Check interface type in ->config(), not ->probe() Date: Fri, 18 Mar 2022 15:50:32 +0100 Message-Id: <20220318145035.10148-12-kabel@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220318145035.10148-1-kabel@kernel.org> References: <20220318145035.10148-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean From: Marek BehĂșn We want to be able to have phydev->interface uninitialized during ->probe(). We should assume that phydev->interface is initialized only before ->config(). Signed-off-by: Marek BehĂșn Reviewed-by: Ramon Fried --- drivers/net/phy/xilinx_gmii2rgmii.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c index 635c0570ef..d92a364365 100644 --- a/drivers/net/phy/xilinx_gmii2rgmii.c +++ b/drivers/net/phy/xilinx_gmii2rgmii.c @@ -26,6 +26,11 @@ static int xilinxgmiitorgmii_config(struct phy_device *phydev) debug("%s\n", __func__); + if (phydev->interface != PHY_INTERFACE_MODE_GMII) { + printf("Incorrect interface type\n"); + return -EINVAL; + } + if (!ofnode_valid(node)) return -EINVAL; @@ -114,11 +119,6 @@ static int xilinxgmiitorgmii_probe(struct phy_device *phydev) { debug("%s\n", __func__); - if (phydev->interface != PHY_INTERFACE_MODE_GMII) { - printf("Incorrect interface type\n"); - return -EINVAL; - } - phydev->flags |= PHY_FLAG_BROKEN_RESET; return 0;