From patchwork Fri Mar 10 14:47:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 13169433 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 C20DCC64EC4 for ; Fri, 10 Mar 2023 15:47:03 +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: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:In-Reply-To:References: List-Owner; bh=JQox9kkWAEiIdJ1MlguotJPVV3AUFMcKFYs3ycKXBCU=; b=zeaNzWDXdAT2Pe jiUvIHq642mYyba1CsgF1diPlzS5jUD+frX5etlu4Cy9x5E10eiMqv2O/Iv4q8aZILBk+oDGwySZn OaGo4M0xI0z57OEGyNbTJOYvwaR4kDjUVplZrmZe96+JnOZA5LaPs5iLQIyvtHtqZZKSWGqObCdsy Nv+ZF3sgGsCPa09Ipak7WxfNzAJ0sXygqd4Nv+pPP6WE2swWWmJZ0kXRZeb1oRj+JCJ73wLbISmJm qERV74b1N6zY9yOLUwrb+9Mf1DiZvl8vgRYF0hox/jqNg18vWgtdI02FU3Asadnd7TS20fL9qJ9Dl ZStXICeT4C4sZtrpywHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paewb-00F3xQ-5k; Fri, 10 Mar 2023 15:46:09 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paewY-00F3vw-H5 for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Mar 2023 15:46:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=UdWW9ncgSIHEZEYSb0mkw0NVObO6RbETPoJE1mKPNzo=; b=hEaIAltm7UQIgldfkoLqgwv7pZ LLY7dcJ6T/o7rhv5GfujlQAgSzhSQl+gIlKcNjiY2ChUmZrZHfYuQzMq1NwtuWJrZbsXSEtQZV/82 U/VZ5G84ysJw58pFjy1jj+JAsTT6npRRXyU4doCdRTuT64J2TCTarvtohQudC+CP8IQTx8HfpxMhu u/SPSNxnv/g09Ym+UIRryjzSSFfqsoVq07MEJcpKsMLYjVh6Dp/uqxN57gxUW9Qw1qocA4xfZ+iU6 Y1t+5dURCZCYGOQaDDLbgaqyDHOq9Av9EvGE6lQhSPBCGzU6PzIhTaZ2vgxgT1Ztx2NE5tVqhsCMk KZQmq7uw==; Received: from mail-oi1-f178.google.com ([209.85.167.178]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pae1h-000UR0-18 for linux-arm-kernel@lists.infradead.org; Fri, 10 Mar 2023 14:47:26 +0000 Received: by mail-oi1-f178.google.com with SMTP id s41so4363783oiw.13 for ; Fri, 10 Mar 2023 06:47:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678459639; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UdWW9ncgSIHEZEYSb0mkw0NVObO6RbETPoJE1mKPNzo=; b=zfpdsGpMmJrcakllNYWmJpI57Mv3jQT12gvecPeuyl81bpb3HUG5B5FVhF/dAt/+ys tvz+YdvkoWyWHIqpHvJx3/crAb/nzMQOJ7jtxCG5QDbU3xUCbZzEMicfTtbGcScah4P2 kZDnhXwjWftylXOIKS71eEbQk2hcEWAzHVsvenCOtw4zWE/xtGVMWQb9vPq25/frLFEN SL1Eju5xwuSR8tTin87fA5Bg01+POJImx6qbuCmbvCHxLfTWgOQ67NZs0NhYeCE5YhFD Ke2yDroPD5Q9TZhQaMkqv9kacehE3ez1nL2SRb6yiezLxbCC/tiIxjx9m/lRMNyFH+yE /pHw== X-Gm-Message-State: AO0yUKVjWvjkvY/YYHZiV7Rl1yPP67YnY05ObbOpTRi70AAjdI5u21cf vg/ybTNwXukapJzvtbo3+A== X-Google-Smtp-Source: AK7set/8L4r+XvpMu69vm6S6XFR1r1QKusZrKwJxtRfFGT1XqqIlwZ3+BTC+mAIkluQcKq5JUFaEUQ== X-Received: by 2002:a05:6808:197:b0:384:311d:5664 with SMTP id w23-20020a056808019700b00384311d5664mr11445048oic.23.1678459638382; Fri, 10 Mar 2023 06:47:18 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id s9-20020acac209000000b00383eaf88e75sm943090oif.39.2023.03.10.06.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:47:17 -0800 (PST) Received: (nullmailer pid 1542071 invoked by uid 1000); Fri, 10 Mar 2023 14:47:04 -0000 From: Rob Herring To: Sudeep Holla , Cristian Marussi , Thierry Reding , Jonathan Hunter Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH] firmware: Use of_property_present() for testing DT property presence Date: Fri, 10 Mar 2023 08:47:04 -0600 Message-Id: <20230310144704.1542045-1-robh@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230310_144724_198106_52ED1326 X-CRM114-Status: GOOD ( 14.31 ) 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 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 Acked-by: Sudeep Holla (for the SCMI part) Acked-by: Thierry Reding --- drivers/firmware/arm_scmi/optee.c | 2 +- drivers/firmware/tegra/bpmp.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/arm_scmi/optee.c b/drivers/firmware/arm_scmi/optee.c index 929720387102..e123de6e8c67 100644 --- a/drivers/firmware/arm_scmi/optee.c +++ b/drivers/firmware/arm_scmi/optee.c @@ -403,7 +403,7 @@ static int setup_static_shmem(struct device *dev, struct scmi_chan_info *cinfo, static int setup_shmem(struct device *dev, struct scmi_chan_info *cinfo, struct scmi_optee_channel *channel) { - if (of_find_property(cinfo->dev->of_node, "shmem", NULL)) + if (of_property_present(cinfo->dev->of_node, "shmem")) return setup_static_shmem(dev, cinfo, channel); else return setup_dynamic_shmem(dev, channel); diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c index 042c2043929d..8b5e5daa9fae 100644 --- a/drivers/firmware/tegra/bpmp.c +++ b/drivers/firmware/tegra/bpmp.c @@ -764,19 +764,19 @@ static int tegra_bpmp_probe(struct platform_device *pdev) if (err < 0) goto free_mrq; - if (of_find_property(pdev->dev.of_node, "#clock-cells", NULL)) { + if (of_property_present(pdev->dev.of_node, "#clock-cells")) { err = tegra_bpmp_init_clocks(bpmp); if (err < 0) goto free_mrq; } - if (of_find_property(pdev->dev.of_node, "#reset-cells", NULL)) { + if (of_property_present(pdev->dev.of_node, "#reset-cells")) { err = tegra_bpmp_init_resets(bpmp); if (err < 0) goto free_mrq; } - if (of_find_property(pdev->dev.of_node, "#power-domain-cells", NULL)) { + if (of_property_present(pdev->dev.of_node, "#power-domain-cells")) { err = tegra_bpmp_init_powergates(bpmp); if (err < 0) goto free_mrq;