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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8A35C433FE for ; Tue, 12 Apr 2022 00:52:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JZ+DJ0tHbIFf6T46QQJC9/mPSn5iSDmWxdQGp2E0xXM=; b=p3qf5LPWunR/tU SbhKETBF1qGuKSWajnNmkqjmW0VQMa0zXcKxkGjCLOjJlAnGbB6Qxmk+9BjtMy/n9wXnQ5W77gGJQ beq9jzFlip9GAHCrJ+PLanG7Ym+4d46tSfuBaFR5Cticm/NJDHghP9/dZ8/icBrox6kZna1x8skC7 VW0l8ZfLWmUPMqO4Vk8ccjcVPv3brjjGafDuRwGeP1xsx0Jc9fMhfZW0Q6cvhY19RWm6pHmHKejJK 7usezYNYq5pAgKl6sj3RgRatQH00tt5fKtYAHpZCdem/MixFlxJ3/Tewtrz662xQZFL+3GXbUre0K 2BXtmX9J3CNdSJN0+4zA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ne4jg-00B3VX-2y; Tue, 12 Apr 2022 00:50:24 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ne4jL-00B3KL-Nk for linux-arm-kernel@lists.infradead.org; Tue, 12 Apr 2022 00:50:05 +0000 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 2A2326184A; Tue, 12 Apr 2022 00:50:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7863C385A9; Tue, 12 Apr 2022 00:50:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649724602; bh=yPzZImCeywqgb6Hi35+BrRKl0GUG10be3drdyior0oY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sdqGJEMM87RgMV62qiEaJQ8pJ7gO5vqRIu0P8Uv/Zb+vHLZwlJl3sz1x4q33VL2sX hc0Rx9BRlqC6IXNUlzhMe/4p8qZf5axPFTHImoGlvVisTKYDTrENnap4Lk0cyAP042 34STeLTORW3T0zCbGA58TqVX9xUEgLX6DNkFQZ61LWX0nlITqkIJFKOswIE1ru+PvT oLBhrNbsbgGiJD4RnKGqUdWxZn4Wih+ePpNnZRS5W4H8aIA5tOQhZQE7w9dnKh+FO9 dski6ZwxPzm5pumwLJTGpFgHNTVb39KjslmsICI7BoAWR9szQT/6CIBaMt5rjcM4LQ D7XUJ+Gfd3J/A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andy Chiu , Greentime Hu , Robert Hancock , Radhey Shyam Pandey , Andrew Lunn , "David S . Miller" , Sasha Levin , kuba@kernel.org, pabeni@redhat.com, michal.simek@xilinx.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.10 20/30] net: axienet: setup mdio unconditionally Date: Mon, 11 Apr 2022 20:48:54 -0400 Message-Id: <20220412004906.350678-20-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220412004906.350678-1-sashal@kernel.org> References: <20220412004906.350678-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220411_175003_874800_0F0ED96E X-CRM114-Status: GOOD ( 15.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Andy Chiu [ Upstream commit d1c4f93e3f0a023024a6f022a61528c06cf1daa9 ] The call to axienet_mdio_setup should not depend on whether "phy-node" pressents on the DT. Besides, since `lp->phy_node` is used if PHY is in SGMII or 100Base-X modes, move it into the if statement. And the next patch will remove `lp->phy_node` from driver's private structure and do an of_node_put on it right away after use since it is not used elsewhere. Signed-off-by: Andy Chiu Reviewed-by: Greentime Hu Reviewed-by: Robert Hancock Reviewed-by: Radhey Shyam Pandey Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index bbdcba88c021..3d91baf2e55a 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -2060,15 +2060,14 @@ static int axienet_probe(struct platform_device *pdev) if (ret) goto cleanup_clk; - lp->phy_node = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); - if (lp->phy_node) { - ret = axienet_mdio_setup(lp); - if (ret) - dev_warn(&pdev->dev, - "error registering MDIO bus: %d\n", ret); - } + ret = axienet_mdio_setup(lp); + if (ret) + dev_warn(&pdev->dev, + "error registering MDIO bus: %d\n", ret); + if (lp->phy_mode == PHY_INTERFACE_MODE_SGMII || lp->phy_mode == PHY_INTERFACE_MODE_1000BASEX) { + lp->phy_node = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); if (!lp->phy_node) { dev_err(&pdev->dev, "phy-handle required for 1000BaseX/SGMII\n"); ret = -EINVAL; -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel