From patchwork Fri Mar 10 14:47:05 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: 13169451 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 CA4E3C64EC4 for ; Fri, 10 Mar 2023 15:49:21 +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=iMP7jAMirhus9PMUZaCF0+onyh5HnDf1O3qoiTKoeGU=; b=JETCRN1kMXP5QD xY1tUNvE2Z1UFeoxjMUXHFxv4HwyU9jPjdK8g4m5OuoAmSUXXfbKJHV7uQsNyteUlxiOLlsd9TfP6 oiZ0JrWkAzXNHp6M66hMZMFvAwh0zcZ1/JaYDKlsW+j3RWc3xXpkaYPDeSx9t2xq5XQz0W7zgg2oI ZTOPe5JHTKI5FGX3FQA4l/DyRHAdgef7wCrFxeDJcFJU9tH/bb6zYPdjRhZznPZWDRYmgvF9q64hk /7YvAgcbQV2ZBTKiaHma/HKblPutJrQzsDpc7yb933VT1YwPWSjReSpVuGy3/49nEEnEQP/WkL6Kp xIoaI86R3cY6d+l31oMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paeym-00F5BU-5z; Fri, 10 Mar 2023 15:48:24 +0000 Received: from desiato.infradead.org ([90.155.92.199]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1paexF-00F4KP-Gl for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Mar 2023 15:46:49 +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=De0I+gp0jvvBU5yajyNpGosHJb+1lemGWKSIFgexoTU=; b=OayIR710qNKkGndgrNZhNgKGVV l8qckAm6fSgvLfh2tmZSu+oeSDFNoyA17sVdVqNSyw8ofLJqvZ3NzKYbPxQ7nl8gDdObs/Qjftx0l LaQHtoTBkdKvuirQOvcbqF99WFX/S17blCEm87H4WwBYSNf2TrjLnBflng6wVuUGDXDb5BbIycf4d RT/4wIKtDei1DYNmSlL/z/q9ksREoOHzSyUpBzs2eDcpmg4dce7S2UDdhMl1ZG0Bfj4qhTm7l3fQ4 /lqi0n+zb7RkXH+/OP/fXhlnokXBv21vgXBs7o9Q4mDOM8ktYS8pTbx8c0mX4kM9BufpE6BhRWdal lALJULeQ==; Received: from mail-ot1-f49.google.com ([209.85.210.49]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pae20-000USH-29 for linux-arm-kernel@lists.infradead.org; Fri, 10 Mar 2023 14:47:43 +0000 Received: by mail-ot1-f49.google.com with SMTP id m25-20020a05683026d900b006941a2838caso3032821otu.7 for ; Fri, 10 Mar 2023 06:47:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678459658; 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=De0I+gp0jvvBU5yajyNpGosHJb+1lemGWKSIFgexoTU=; b=B1LslGrB7zbGYlKH7MtRJ+Cl2opWt+0qhAshEDGD62MCHbveWKhftNgujbqHPUrCsG ji+F9Q5BV5wR/RVuh3Yn33CAZLxFybLjK7j0i9JpT4LGt6hRDmzLHwXqK/nnnIr8NTI6 ZbAfVzi9OoHKe7yFDLoM0/Gsnsq/9Nm1QxMly9UBe9m3X3Clfg8dh8Vg2C+LE0AUArMo xhnIeBthbXNUWqB571GztmAy5oYasWmzCeRsui0F2xI30o8CXp2aRAhpgMUmT88Ebhw/ GifT1k/M/DvjQXq7a6XRGWPK7xN2wG0/PRch/RhXiJqbShTIDMKD7mnmQ2fztt6CwbcU fv6g== X-Gm-Message-State: AO0yUKWXk9x+nod+RHgboflfWYh1r+DI7BYTG5IwDQ4qr5cgV5YaVhCO 3gbCJ1tGdYUZuh6YmzeaSQ== X-Google-Smtp-Source: AK7set/ntzmW14qqdxNy7hqCHBPFyi/dFBckcMxYLZsj8GRAJipyUOv4BdYp/DpTEtlKrJHFgZjnoA== X-Received: by 2002:a9d:387:0:b0:686:50ca:7404 with SMTP id f7-20020a9d0387000000b0068650ca7404mr1271124otf.4.1678459658294; Fri, 10 Mar 2023 06:47:38 -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 e6-20020a9d4906000000b006884c42a38asm118125otf.41.2023.03.10.06.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:47:37 -0800 (PST) Received: (nullmailer pid 1542233 invoked by uid 1000); Fri, 10 Mar 2023 14:47:05 -0000 From: Rob Herring To: Liu Ying , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Chen-Yu Tsai , Samuel Holland , Emma Anholt Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-sunxi@lists.linux.dev Subject: [PATCH] drm: Use of_property_present() for testing DT property presence Date: Fri, 10 Mar 2023 08:47:05 -0600 Message-Id: <20230310144705.1542207-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_144741_078505_DC2FD915 X-CRM114-Status: GOOD ( 16.64 ) 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 Reviewed-by: Dmitry Baryshkov Reviewed-by: Liu Ying # i.MX bridge Reviewed-by: Jernej Skrabec --- drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c | 2 +- drivers/gpu/drm/drm_mipi_dsi.c | 2 +- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- drivers/gpu/drm/sun4i/sun4i_backend.c | 2 +- drivers/gpu/drm/sun4i/sun8i_mixer.c | 2 +- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c index 9e5f2b4dc2e5..fab139b324af 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-link.c @@ -313,7 +313,7 @@ imx8qxp_pixel_link_find_next_bridge(struct imx8qxp_pixel_link *pl) } /* specially select the next bridge with companion PXL2DPI */ - if (of_find_property(remote, "fsl,companion-pxl2dpi", NULL)) + if (of_property_present(remote, "fsl,companion-pxl2dpi")) bridge_sel = ep_cnt; ep_cnt++; diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index b41aaf2bb9f1..7900a4707d7c 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -329,7 +329,7 @@ int mipi_dsi_host_register(struct mipi_dsi_host *host) for_each_available_child_of_node(host->dev->of_node, node) { /* skip nodes without reg property */ - if (!of_find_property(node, "reg", NULL)) + if (!of_property_present(node, "reg")) continue; of_mipi_dsi_device_add(host, node); } diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index ce6b76c45b6f..2359dca80492 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -964,7 +964,7 @@ static void adreno_get_pwrlevels(struct device *dev, gpu->fast_rate = 0; /* You down with OPP? */ - if (!of_find_property(dev->of_node, "operating-points-v2", NULL)) + if (!of_property_present(dev->of_node, "operating-points-v2")) ret = adreno_get_legacy_pwrlevels(dev); else { ret = devm_pm_opp_of_add_table(dev); diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c index 38070fc261f3..b11dbd50d73e 100644 --- a/drivers/gpu/drm/sun4i/sun4i_backend.c +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c @@ -792,7 +792,7 @@ static int sun4i_backend_bind(struct device *dev, struct device *master, dev_set_drvdata(dev, backend); spin_lock_init(&backend->frontend_lock); - if (of_find_property(dev->of_node, "interconnects", NULL)) { + if (of_property_present(dev->of_node, "interconnects")) { /* * This assume we have the same DMA constraints for all our the * devices in our pipeline (all the backends, but also the diff --git a/drivers/gpu/drm/sun4i/sun8i_mixer.c b/drivers/gpu/drm/sun4i/sun8i_mixer.c index bafee05f6b24..11d5244a5aa5 100644 --- a/drivers/gpu/drm/sun4i/sun8i_mixer.c +++ b/drivers/gpu/drm/sun4i/sun8i_mixer.c @@ -391,7 +391,7 @@ static int sun8i_mixer_bind(struct device *dev, struct device *master, mixer->engine.ops = &sun8i_engine_ops; mixer->engine.node = dev->of_node; - if (of_find_property(dev->of_node, "iommus", NULL)) { + if (of_property_present(dev->of_node, "iommus")) { /* * This assume we have the same DMA constraints for * all our the mixers in our pipeline. This sounds diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index ea22c9bf223a..bec1e0cdddb3 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -3018,7 +3018,7 @@ static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi) struct device *dev = &pdev->dev; int ret; - if (!of_find_property(dev->of_node, "interrupts", NULL)) { + if (!of_property_present(dev->of_node, "interrupts")) { dev_warn(dev, "'interrupts' DT property is missing, no CEC\n"); return 0; }