From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 666BFC61D9D for ; Wed, 25 Jan 2023 05:15:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229953AbjAYFPJ (ORCPT ); Wed, 25 Jan 2023 00:15:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229758AbjAYFPI (ORCPT ); Wed, 25 Jan 2023 00:15:08 -0500 Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C515E30C1; Tue, 24 Jan 2023 21:15:05 -0800 (PST) Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 30P5DFVr110850; Tue, 24 Jan 2023 23:13:15 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1674623595; bh=re1yuXRG1QzWfbml926PUa+KfAnb805uYLtXy/6QWZ0=; h=Date:CC:Subject:To:References:From:In-Reply-To; b=NDsjfut0T3p7vR3aO6ByE4gg3fZjdYpYkxKVaFHEcN9DDymNkY7sXGQtuQde/NpN+ s1DBVVXRJ/7e2buVzRva7Rka8C40zLivnm/eYg6QS5go1r5KUVx0c2umJXiMSl8r0b npSY3OTjeIyWPydyJhIPNy0X5L+qrfNUJ7i83FYU= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 30P5DFDk056971 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 24 Jan 2023 23:13:15 -0600 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Tue, 24 Jan 2023 23:13:15 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Tue, 24 Jan 2023 23:13:15 -0600 Received: from [172.24.145.61] (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 30P5D6Wo061117; Tue, 24 Jan 2023 23:13:07 -0600 Message-ID: Date: Wed, 25 Jan 2023 10:43:06 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 CC: , , , , , , , , Subject: Re: [PATCH v2 6/9] net: ethernet: ti: am65-cpsw: Convert to devm_of_phy_optional_get() Content-Language: en-US To: Geert Uytterhoeven , Vinod Koul , Jonathan Corbet , Madalin Bucur , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Horatiu Vultur , , Thierry Reding , Lorenzo Pieralisi , Rob Herring , =?UTF-8?Q?Krzysztof_Wilczy=c5=84ski?= , Bjorn Helgaas , Jonathan Hunter , Kishon Vijay Abraham I , Alan Stern , Greg Kroah-Hartman , Krzysztof Kozlowski , Alim Akhtar , Russell King References: <3d612c95031cf5c6d5af4ec35f40121288a2c1c6.1674584626.git.geert+renesas@glider.be> From: Siddharth Vadapalli In-Reply-To: <3d612c95031cf5c6d5af4ec35f40121288a2c1c6.1674584626.git.geert+renesas@glider.be> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On 25/01/23 00:07, Geert Uytterhoeven wrote: > Use the new devm_of_phy_optional_get() helper instead of open-coding the > same operation. > > Signed-off-by: Geert Uytterhoeven > --- > v2: > - Rebase on top of commit 854617f52ab42418 ("net: ethernet: ti: > am65-cpsw: Handle -EPROBE_DEFER for Serdes PHY") in net-next > (next-20230123 and later). > --- > drivers/net/ethernet/ti/am65-cpsw-nuss.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c > index c696da89962f1ae3..794f228c8d632f7a 100644 > --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c > +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c > @@ -1460,11 +1460,9 @@ static int am65_cpsw_init_serdes_phy(struct device *dev, struct device_node *por > struct phy *phy; > int ret; > > - phy = devm_of_phy_get(dev, port_np, name); > - if (PTR_ERR(phy) == -ENODEV) > - return 0; > - if (IS_ERR(phy)) > - return PTR_ERR(phy); > + phy = devm_of_phy_optional_get(dev, port_np, name); > + if (IS_ERR_OR_NULL(phy)) > + return PTR_ERR_OR_ZERO(phy); Reviewed-by: Siddharth Vadapalli Regards, Siddharth.