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 X-Patchwork-Id: 67443 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp944441wrd; Fri, 10 Mar 2023 07:45:26 -0800 (PST) X-Google-Smtp-Source: AK7set+L1ncDraukPOa07azzkjGxw26BEvW8GnOyNXVUziV1hSb6AAM2q5NCY+zgpPpE62pqSHbs X-Received: by 2002:a62:5b87:0:b0:61d:f3a8:aff0 with SMTP id p129-20020a625b87000000b0061df3a8aff0mr9233922pfb.12.1678463125836; Fri, 10 Mar 2023 07:45:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678463125; cv=none; d=google.com; s=arc-20160816; b=jVKhPhd21YxubVpEPBD4dPQTGdpvnj7fRlZIxsKhXzWYy5D99N6qsRGWuwa3JV7Zmp exWvQqUiejTTKSiheVSe69F4QV2aWs6uLZdUN0pY2n1m7BC4g9h2kjRWqo6dcFYBpZ2U Vwu9yAjVQ88TuUguTwt8qjpuUWyoS2uFK3CZJmmX0WjG3CjRkPUwlMWpBYT9ym3QRi+R KdfyAn1QgGgh8LLx7b4491RLwmqzqaVE27TUJjH0oJu1f+z5y/L9H3S9ZzAh5gEYi0lO Qjm1gCOEKPWvx/HLQc4vwyzYV/HpLdQUbxNTCBMImlgQz7uIfjeniEWwaXVbl4VWknRv aiGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=9ufsybUkbmkBZT7Reugv4yMUeSADY5agPgq6hpQcf+Q=; b=fHrZvA+Kq6Hi+QSVRvfANCALKZM9qT9gX/Kaa88RkD6uVrmeVWJ8Qiqe9bRhOfHOKw ox+01iIHhjHri8fKZlivcuNYeJqbadokk7KNp+/BLeCzxas1bVE0CUX1vpiZ/xqVXmQ9 Qcekm5IGiPKrSvwLMh/Kf3K5GrPvhDvTUaTwbcmSFGQ6PKi4egFqL0DVdafyb5eRGijm OqTQWna26sXYy8mB/WJAhpFhimo3LiankAzHUGdSRIjdGoJ6EF2UhRTYl1S8DO5yJ1hd bCbFpEtcf7BbGhImn4dQoEDjvNaHv2+zFwrDxaET8RiA16NG/Hjmnrx0gl6J6RFyF66Z tG2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l185-20020a6388c2000000b00502e38f7cefsi83243pgd.686.2023.03.10.07.45.12; Fri, 10 Mar 2023 07:45:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233376AbjCJOvE (ORCPT + 99 others); Fri, 10 Mar 2023 09:51:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233348AbjCJOt4 (ORCPT ); Fri, 10 Mar 2023 09:49:56 -0500 Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C59C2728E; Fri, 10 Mar 2023 06:47:57 -0800 (PST) Received: by mail-ot1-f41.google.com with SMTP id l15-20020a9d7a8f000000b0069447f0db6fso3046757otn.4; Fri, 10 Mar 2023 06:47:57 -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=fXOqHEq27q7Nfg5k80wlWgFRkVkHn/HVK/Va/Az8Z5RlwNmSV4A4hwV+4C7fBejmcR uUrnulJhFhPL2P0GD4N7/oZGV/A6sahdG4k7MXxbwPJLnpHyNTbZ4cr4XQ0LZBUSKUvu ZS2Xo0ZvkwRwUf6qNNQAAbchKRjcZIvo+luBS3iliOqnuVLP36RplzyN/Nn0i7cq6Gyw gkqsD4bEjsd9qHbBSWDFD3W7HzZEDTQKRab1+mHaLLNWUyIb9NGcs1kPmeklgLPlo1ff j4ZRs9iz8ZlbCSLgA1HSUIiha/IFMc1OAmRs5gtKuWkOUwPh38MfxutQoQ2sJnWRvHzv ejcg== X-Gm-Message-State: AO0yUKWGhDomcyPhxosZulg3+/zC7ytvnnHNWC1WuecbHt0VVGbwcNfZ cSlfHNdLpHads/h8tOA5TA== 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-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759996150647447980?= X-GMAIL-MSGID: =?utf-8?q?1759996150647447980?= 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;