From patchwork Fri Mar 10 14:47:24 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: 13169450 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 0F0D7C64EC4 for ; Fri, 10 Mar 2023 15:49:02 +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=zMYyKg51wcN9qC8vRTwwad1Yvk6/gSj5jh4aEC8S0lo=; b=jVvQPCzf6say+a Q+LfbvPKeeZoMl2Mfz7hsTD6NuCzLa+c1hZnfLRsd5f/jodBrQztRCk5FVdCHyjJ0fPI1a87szl7m OnHyFCDfP++ulYg14hFXTyU3AJ9EL4XvgpvGnUZIhuDnuWAmsYg8z8zczKVef9ezK3iw/NFBn954J THbtv5XqxfqfVt2Ic09fXkWWnyF0YZD45ZAW2fkk56lQkj1TBi+9glVnUdgY3TJJ+DbyVh3MN7eij yNhgSN0wpIU01RPrPdiS80r01Okvirmdh+L6O0/M5IE3T5bo/i8W1H5saVlGXCkE6b/aMbxUGg7Fx Wlh83QMuAPmc/0TxXmaQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paeyP-00F4zV-KR; Fri, 10 Mar 2023 15:48:02 +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 1paeww-00F48p-LS for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Mar 2023 15:46:30 +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=9ufsybUkbmkBZT7Reugv4yMUeSADY5agPgq6hpQcf+Q=; b=KC9rfgrM1CIJgivtHd1mF8YQil zP13CrFw5ZxFj8TebaDYTWn44ceFGXuqJL0uDzGneoBswFb0BNnjW+mwyjTGdTF2iGpr0pyI4e5kp ZweTGxRXyDWM4d4Cp2rnUA6cDiHFlhSSxe5+5XujoyK/IO3hqHCh1v31pvdZZCCOcfKMuSsnieFb3 4Dl4dlJYIK4DrNLwVamhnMRCZTQ45CxT5V+/Y/snWxm7a6wRXuYs/7UssJx1e7q+BSUwAIRJoeJlL v9Xa+hIHK1l38HxAo9P4AQ1MVrnhFJD73qJ9s2Z4ifjHLTv8Z6JyUe9NbGGLxkOEW4+kvfWCqUEyq hIl14etw==; Received: from mail-ot1-f47.google.com ([209.85.210.47]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pae2B-000UU0-10 for linux-arm-kernel@lists.infradead.org; Fri, 10 Mar 2023 14:47:55 +0000 Received: by mail-ot1-f47.google.com with SMTP id r23-20020a05683001d700b00690eb18529fso3053683ota.1 for ; Fri, 10 Mar 2023 06:47:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678459669; 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=9ufsybUkbmkBZT7Reugv4yMUeSADY5agPgq6hpQcf+Q=; b=TWXY9x25yCIFSTTo1g3EjKTz1KqjTZd4B2NAalbDff90Mif6P+cYtMX90I3tAGhW9W 0Vt2vr4bqEomhfy/EV+VPNnsIZ+UfwfZGEZrVjYNd7BJLDT5qHmfL0n3B7EjHynXyZdV F8HqSUnvH4uQEg4CKS622LOsG/gJNmH+ureIPnZBx6nq6XbOkczyXBwk/nz2KHbeXCJn 5Y6Z9eFTm1sXJ1KcEP/EjHsgjoV/ZpK1DF7IBrNY2ru74JjqFa+B2WZDuxKXiFvN4W7d MoP0wjRHKgAjhtJdg9ejrMvgWWz9s0XWNSNkXYCYZeowPubHKjTk1Qs2FsJtMoVjIdS6 WxNA== X-Gm-Message-State: AO0yUKWvGxDmDC7ECoz4g+pHnvYeentkIHmuUq+/XgzPb6v9zx0t4X2I TpynYLmGHks8jJo2fUzUteM3VGqQoQ== X-Google-Smtp-Source: AK7set+11VqaTWYpd4ZPjYWm+8tkVPkSW2LDYoZdkK73WN5bvy/yIyRpxroutIcq90hTe1q+HMYn5w== X-Received: by 2002:a05:6830:449e:b0:690:dbb5:df32 with SMTP id r30-20020a056830449e00b00690dbb5df32mr15274511otv.25.1678459669215; Fri, 10 Mar 2023 06:47:49 -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 e12-20020a9d730c000000b0068bb7bd2668sm97181otk.73.2023.03.10.06.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:47:48 -0800 (PST) Received: (nullmailer pid 1545341 invoked by uid 1000); Fri, 10 Mar 2023 14:47:25 -0000 From: Rob Herring To: Michal Simek Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] soc: xilinx: Use of_property_present() for testing DT property presence Date: Fri, 10 Mar 2023 08:47:24 -0600 Message-Id: <20230310144725.1545315-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_144753_281955_0DA9C6DD X-CRM114-Status: GOOD ( 14.33 ) 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 --- drivers/soc/xilinx/zynqmp_power.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c index 78a8a7545d1e..641dcc958911 100644 --- a/drivers/soc/xilinx/zynqmp_power.c +++ b/drivers/soc/xilinx/zynqmp_power.c @@ -218,7 +218,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev) } else if (ret != -EACCES && ret != -ENODEV) { dev_err(&pdev->dev, "Failed to Register with Xilinx Event manager %d\n", ret); return ret; - } else if (of_find_property(pdev->dev.of_node, "mboxes", NULL)) { + } else if (of_property_present(pdev->dev.of_node, "mboxes")) { zynqmp_pm_init_suspend_work = devm_kzalloc(&pdev->dev, sizeof(struct zynqmp_pm_work_struct), @@ -240,7 +240,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Failed to request rx channel\n"); return PTR_ERR(rx_chan); } - } else if (of_find_property(pdev->dev.of_node, "interrupts", NULL)) { + } else if (of_property_present(pdev->dev.of_node, "interrupts")) { irq = platform_get_irq(pdev, 0); if (irq <= 0) return -ENXIO;