From patchwork Fri Mar 10 14:47:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 67448 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp945673wrd; Fri, 10 Mar 2023 07:47:47 -0800 (PST) X-Google-Smtp-Source: AK7set8XuJHXcg+Cgbr/4PWZ5vnZ+co33jsiEIgKaVgBVlUpvwKkoiNCXBRkBzPDy7YLiUsiwLuu X-Received: by 2002:a05:6a20:7d95:b0:ce:ca9:ab30 with SMTP id v21-20020a056a207d9500b000ce0ca9ab30mr27152930pzj.36.1678463267330; Fri, 10 Mar 2023 07:47:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678463267; cv=none; d=google.com; s=arc-20160816; b=aJ0s3PWq8FVYpfLOAWoXSERUaTkIlUJYADmNaepH1yOZog7nNlQIlIsGYL9Y5fs1kc 0nuXnc3H/YGquu5zo44CM8r5o8TL6BuaEvHwT2w7f+01iD6f/48dY9vQ+6jyWdH/FlZP G9f4pLihgXuQw68FuMRiwfd1P4vKkI8NTl7ULnTX4MFcZgq16hI2ulgRB6P79eCX5R9q CSpW7Nt7+gBirE6axWyPctPonLcnEun6thuEAWQbBaAXyRUcYFq1TP8cZQciLeuEr09p RFV+mEW2WgsyYkyLE8ODfyQ1jF2TMhOVKXMMFxUfgOOGrboUhcfUmduAQKfd/MjJp/UN cgeA== 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=6cw44gWatMHAFXsp5Bf1XmtOCAdzF/BFR6Jh05S7SHc=; b=HPMovHiWNuPw9Hib1/8XOCEu4+5L/OfqOsosuLj4E9oyNOsc0JLuZW10YU9VIT5YKe OQ7M66yNVzY6PWslzd4gvdgYpG3z2sIxgRQfvIK8f4nRef8R1BRkNQaI5bRu+nBzG6NR kIKaTiOjaBf1rwa9OSD4CBlu+xBcoCUd/nyW6E1IaEhmqGpf2OdCHnerKDY03yJjE8zL DtY4Dpg4ueT4aXvYjNi7ySdfx71aBuXYEJ3yQapdcpzK9nzzPwaX4TWYlMmVyEjr54qy K3qz2xSoFWLMDe0F4KGMxZOe7roYJ4Wb0t0j2tmXadZ73R6/Jybm+k9UzPGlSNesIVYt BsPg== 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 y10-20020a65528a000000b004fb95c8f647si106606pgp.407.2023.03.10.07.47.33; Fri, 10 Mar 2023 07:47:47 -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 S233240AbjCJOvY (ORCPT + 99 others); Fri, 10 Mar 2023 09:51:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233188AbjCJOuK (ORCPT ); Fri, 10 Mar 2023 09:50:10 -0500 Received: from mail-oa1-f44.google.com (mail-oa1-f44.google.com [209.85.160.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BC6D4AFC8; Fri, 10 Mar 2023 06:48:09 -0800 (PST) Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-176b48a9a05so6137676fac.0; Fri, 10 Mar 2023 06:48:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678459674; 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=6cw44gWatMHAFXsp5Bf1XmtOCAdzF/BFR6Jh05S7SHc=; b=pspoFOKlw7WaDoDaeAY5OAuw255rT+bwC8Qh48Zl6WlycYKE8K+8wfVODYeqzPfY1W QHVEEfBeNmZMCcKGZj6S2wrcN1f+l04k/GuO/UyO1fZGdFHQGDBr8QD7KgJoZOL1xTwY No9w/JSw9eLEbRXQZLJ3Wg9ia93mqzjut44eeCfjYxP10LBymTI7rJhVLlhPdy1jMhvr YZXOzwg3cTQNIy10zwl1dXwNhh7MpMbWoZLWrmKsLE+zMpqcH2P6jorvVYvHRtwpS50H RU4VwrpYWHykbfRSupGBAwFdMpIcEoD5N3n35rGr0RNy49D/WxIumvF+ChJ8rJ88J6MZ Hl/Q== X-Gm-Message-State: AO0yUKWjDXWE9b6H+gIlS9onItg2VDqSTMNu4YyBf7GNhQ6WcQ0h9Dre dkLTTTmAO8Q6b021+xvnfg== X-Received: by 2002:a05:6870:9724:b0:176:4631:3c0d with SMTP id n36-20020a056870972400b0017646313c0dmr16556971oaq.34.1678459673974; Fri, 10 Mar 2023 06:47:53 -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 j21-20020a056870d45500b0017697dfc20fsm118605oag.12.2023.03.10.06.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:47:53 -0800 (PST) Received: (nullmailer pid 1546147 invoked by uid 1000); Fri, 10 Mar 2023 14:47:30 -0000 From: Rob Herring To: Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] backlight: hx8357: Use of_property_present() for testing DT property presence Date: Fri, 10 Mar 2023 08:47:30 -0600 Message-Id: <20230310144730.1546101-1-robh@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-1.1 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_H2, 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?1759996298906281111?= X-GMAIL-MSGID: =?utf-8?q?1759996298906281111?= 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: Daniel Thompson --- drivers/video/backlight/hx8357.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/backlight/hx8357.c b/drivers/video/backlight/hx8357.c index 9b50bc96e00f..f76d2469d490 100644 --- a/drivers/video/backlight/hx8357.c +++ b/drivers/video/backlight/hx8357.c @@ -617,7 +617,7 @@ static int hx8357_probe(struct spi_device *spi) return -EINVAL; } - if (of_find_property(spi->dev.of_node, "im-gpios", NULL)) { + if (of_property_present(spi->dev.of_node, "im-gpios")) { lcd->use_im_pins = 1; for (i = 0; i < HX8357_NUM_IM_PINS; i++) {