Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3175079pxb; Mon, 18 Apr 2022 18:07:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5uAJHdaVL2bb/btvGdsLeljtyPWX5Y17VK+r2sMpU2pOHExU2IVIcqjPirQu3gJ+CZy95 X-Received: by 2002:a50:871e:0:b0:41d:77c0:6927 with SMTP id i30-20020a50871e000000b0041d77c06927mr14899644edb.354.1650330470672; Mon, 18 Apr 2022 18:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650330470; cv=none; d=google.com; s=arc-20160816; b=wWCeWymwsOYqfJZI50pTLA6DdnfylF0u05i2p5vXVsdbX8oD4saGhJxSwY6A1bOXxx SnU8wOlYUEoKNRJhvZ1M3qaNlCunhSbT9GEOmS49ABg2MRnVkO0mltuNyfIVM7ge2fdP U8YdvDkWbTweKcUBrI+LK9oldGo8OHFbbFkIueHQMkyJ7IUfGAyNMhA58SZGJlhHv2Bh PHr3YbnwNgfqXDcfZxMrvjiHGQi5kEDoHStBvL/rqeNdMjNJUFMCMCUF9TV7tt8IyL82 E4r3umA7B1R0OkMAIA7CA8LjDLIWoCFYDvqfrYK5dxQ9HJGiOvgSG8tsytGfSrZQSGxn BPtA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=w2baaMQ4Cbm/DIgqpgsEcQ7zTTJnia4yBYpBxqrc0mM=; b=oOxPk9QDlhfwrPir4cCdOlzuEe6y3C+sMgPjfRoypCBZlN48Fk+AXwnvj1imxShdnw 1D2iy5adAiP5IGWMtIK+KWw9C7vgziTop03lhPmZcljY/B3rwFfL4cNH/eUAftcYh292 1kA0QFNK5BZoffVzIJrhsxvg7F42+tFQ3gkBFf7wISt0hvzA/GzppNPdBMN2qIzYeHFs SBKYz04OisgMKuFKkENKkVP6QCRGFCDnR0KnXyhNES5gQpV1WPg59OrMjnLMigw9OS5t mQuc5rSLaj4dfuapVPZfnGRYpYudhKkBgWR4WeBOGhZEkzpumocRXoSIr4j8dfkwSpjO 2LbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Gbs8/Zmu"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m26-20020a1709060d9a00b006e7fd3f1dd2si6953021eji.1001.2022.04.18.18.07.26; Mon, 18 Apr 2022 18:07:50 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Gbs8/Zmu"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237506AbiDRMfK (ORCPT + 99 others); Mon, 18 Apr 2022 08:35:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239901AbiDRM3H (ORCPT ); Mon, 18 Apr 2022 08:29:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F30922BC6; Mon, 18 Apr 2022 05:22:49 -0700 (PDT) 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 9B49F60F5E; Mon, 18 Apr 2022 12:22:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A40AEC385A1; Mon, 18 Apr 2022 12:22:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650284568; bh=XTrLvknlgVp4TlnwSCgBg+A1FlHeQZ95oTe5GNJz45A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gbs8/ZmuIJifBEP/IsaG8eUvUtHFNs4Qarf0pEbfGBC5m75W091lmyzhITSpOsakl RU022U6aQ/0JXQJPlearfUojcfeE/fjm6Gywfo1SuXDWphOce0FFL75SNDqsI1jyr+ VK2yBQPVRnqFxn1pETbHMI9EOeifesiqSGNAAA6U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Chiu , Greentime Hu , Robert Hancock , Radhey Shyam Pandey , Andrew Lunn , "David S. Miller" , Sasha Levin Subject: [PATCH 5.17 157/219] net: axienet: setup mdio unconditionally Date: Mon, 18 Apr 2022 14:12:06 +0200 Message-Id: <20220418121211.279923973@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121203.462784814@linuxfoundation.org> References: <20220418121203.462784814@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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 90d96eb79984..a960227f61da 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -2072,15 +2072,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