From patchwork Wed Jan 18 10:15:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13106038 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 533F1C38159 for ; Wed, 18 Jan 2023 10:17:16 +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=5ncgj8QM//cv7skItfp9hLA42Y1QkVpBs3Yed2unAVM=; b=PKS4qyD/AZEdEh vl/kwFmowCOYazW8OZ6ulththYyVOm8+D+0Xrs7P4irBXWebjGL3Ex0ywxZHkKTHKlVx9T9yx5fUW O9joeSg4wyM2E3vcw3k4hSyCaNMvauOI4JKbZyR8ymhIZ16A66BSOMK9QKf16qpRxsWZiv/k/4A+l mpT2Gy17w+6+wu+t+bIIREnsIQooV9SmKq7v8BqGB2JzAQpVcRVSVy1Vx1rtF31VoKCITf+8RA5Yi RgXpAqcI+7z6JCLNsQD3SqPsRMgInTgJYnJ+UKBKSdnbHlAhfzcZT7dhNj+ZC5oqy3JVRsR6Wl0vb iLRRZuhZAO3kzPvMt6Rg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pI5UD-000Ilz-Bb; Wed, 18 Jan 2023 10:16:05 +0000 Received: from baptiste.telenet-ops.be ([2a02:1800:120:4::f00:13]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pI5U0-000If5-Aw for linux-arm-kernel@lists.infradead.org; Wed, 18 Jan 2023 10:15:55 +0000 Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed50:4745:2e6d:e3a6:3327]) by baptiste.telenet-ops.be with bizsmtp id AAFN2900E2zf9gW01AFN4M; Wed, 18 Jan 2023 11:15:42 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1pI5TQ-005aIV-N1; Wed, 18 Jan 2023 11:15:22 +0100 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1pI5TW-001JVp-1J; Wed, 18 Jan 2023 11:15:22 +0100 From: Geert Uytterhoeven To: Madalin Bucur , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Horatiu Vultur , UNGLinuxDriver@microchip.com, Thierry Reding , Lorenzo Pieralisi , Rob Herring , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Bjorn Helgaas , Jonathan Hunter , Vinod Koul , Kishon Vijay Abraham I , Alan Stern , Greg Kroah-Hartman , Krzysztof Kozlowski , Alim Akhtar , Siddharth Vadapalli , Russell King Cc: netdev@vger.kernel.org, linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org, linux-phy@lists.infradead.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 3/7] net: lan966x: Convert to devm_of_phy_optional_get() Date: Wed, 18 Jan 2023 11:15:16 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230118_021552_618811_91BDE6E9 X-CRM114-Status: GOOD ( 11.34 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use the new devm_of_phy_optional_get() helper instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven Reviewed-by: Steen Hegelund --- drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c index cadde20505ba0689..d64a525cdc9ea18b 100644 --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c @@ -1147,9 +1147,8 @@ static int lan966x_probe(struct platform_device *pdev) lan966x->ports[p]->config.portmode = phy_mode; lan966x->ports[p]->fwnode = fwnode_handle_get(portnp); - serdes = devm_of_phy_get(lan966x->dev, to_of_node(portnp), NULL); - if (PTR_ERR(serdes) == -ENODEV) - serdes = NULL; + serdes = devm_of_phy_optional_get(lan966x->dev, + to_of_node(portnp), NULL); if (IS_ERR(serdes)) { err = PTR_ERR(serdes); goto cleanup_ports;