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 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 D7597C6FD19 for ; Mon, 13 Mar 2023 10:34:09 +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:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hht7Bw8aNFd4lsfgTkB8y9tR9ESPAEP7ekfmN3TK8FY=; b=d6AxX1agX1OXDJ NplsrP49dmjPZBdB/l3l1QCKW42bqN0GsZsX3OpQqXABGFDM0ZDbHPPeNJJXL/2hLtes4RWT5Hl3B bRMaWMQfqZ7td2kGFl4h04WDhTQ+RYEmmaZyLcHAfv4fMSjgeQM+TdKkrmRl31D2wWceiDEEgeo8I ft0NuZXVBTmnMphd4Dsck5ec4tmiKDH7vF/BymmYCcQn6evDZJNJnJwDZxYVCxox27cC5XvfLSYsw sycAYLclW9u4vyA0GVEf066MxthzWJmmbXsqvBo9/xWbHdOQnAqwbZqJooGPYxrIhzqi7ivyo+Ier 1F1xAhbcoh0FUlVyR4aQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbfSO-005B1G-Jt; Mon, 13 Mar 2023 10:31:08 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbfOP-005AXS-12; Mon, 13 Mar 2023 10:27:02 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5925E152B; Mon, 13 Mar 2023 03:27:43 -0700 (PDT) Received: from slackpad.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3AB2D3F71A; Mon, 13 Mar 2023 03:26:58 -0700 (PDT) Date: Mon, 13 Mar 2023 10:26:48 +0000 From: Andre Przywara To: Rob Herring Cc: Vinod Koul , Kishon Vijay Abraham I , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , devicetree@vger.kernel.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] phy: Use of_property_present() for testing DT property presence Message-ID: <20230313102648.324f6e75@slackpad.lan> In-Reply-To: <20230310144720.1544600-1-robh@kernel.org> References: <20230310144720.1544600-1-robh@kernel.org> Organization: Arm Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230313_032701_331596_60CD4E62 X-CRM114-Status: GOOD ( 16.80 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On Fri, 10 Mar 2023 08:47:20 -0600 Rob Herring wrote: > It is preferred to use typed property access functions (i.e. > of_property_read_ functions) rather than low-level > of_get_property/of_find_property functions for reading properties. As > part of this, convert of_get_property/of_find_property calls to the > recently added of_property_present() helper when we just want to test > for presence of a property and nothing more. > > Signed-off-by: Rob Herring (for both:) Reviewed-by: Andre Przywara Cheers, Andre > --- > drivers/phy/allwinner/phy-sun4i-usb.c | 2 +- > drivers/phy/broadcom/phy-bcm-ns-usb2.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c > index fbcd7014ab43..fc9f6fb447a0 100644 > --- a/drivers/phy/allwinner/phy-sun4i-usb.c > +++ b/drivers/phy/allwinner/phy-sun4i-usb.c > @@ -758,7 +758,7 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev) > return PTR_ERR(data->vbus_det_gpio); > } > > - if (of_find_property(np, "usb0_vbus_power-supply", NULL)) { > + if (of_property_present(np, "usb0_vbus_power-supply")) { > data->vbus_power_supply = devm_power_supply_get_by_phandle(dev, > "usb0_vbus_power-supply"); > if (IS_ERR(data->vbus_power_supply)) { > diff --git a/drivers/phy/broadcom/phy-bcm-ns-usb2.c b/drivers/phy/broadcom/phy-bcm-ns-usb2.c > index 6a36e187d100..269564bdf687 100644 > --- a/drivers/phy/broadcom/phy-bcm-ns-usb2.c > +++ b/drivers/phy/broadcom/phy-bcm-ns-usb2.c > @@ -107,7 +107,7 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev) > return -ENOMEM; > usb2->dev = dev; > > - if (of_find_property(dev->of_node, "brcm,syscon-clkset", NULL)) { > + if (of_property_present(dev->of_node, "brcm,syscon-clkset")) { > usb2->base = devm_platform_ioremap_resource(pdev, 0); > if (IS_ERR(usb2->base)) { > dev_err(dev, "Failed to map control reg\n"); -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy