From patchwork Fri Mar 10 14:47:23 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: 13169436 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 82AC1C6FA99 for ; Fri, 10 Mar 2023 15:48:07 +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=rNC+wZw2kcyhDqtFpKXgOhv6hqp0UP5mkZ9hN07ma7M=; b=QSHM6akpeQXzwd FboEjiBV8BNTTvl6zOpWBKNRmPPxbDrg6fIanmrhDUrjxCFOB+UnqjDaAOf4SDYbqFOVI9bnlvc/l RY5QP1A/2qhhEACUZN2OASnm28P4uXCTsknp3z54wbmLnU1aqA3M4wUm3KJh+3z6BzOtyX9KSTosn Tg7cxir+bw0A0BlF1XPYRZw1RKAprOXfcgk6zNY8tgHZluPNQ/CEziGEQdXrOahfkU/4VdPjPa7jA CzS3fLbC7NEEN6+79914BbFXpGczrRTixtEfvIscQdQK6zhsGY6/5iSROPsw9F433nX1hR2Nu1zfI ixCHLLd9Miq/yfM9u4zA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1paexU-00F4Rx-GV; Fri, 10 Mar 2023 15:47:04 +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 1paewn-00F43p-Po for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Mar 2023 15:46:21 +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=bIEHlVrmVBM0unFLHI/kdGTckBhGv/jeyiKkRJBBR3A=; b=cY5IzoJSu12KHrSAEADJzClHpY HBFkDs1WpY8QDqmKh9BKVw+co/WvYHvzQ8UxjFwZtg2vkyVTN4+aWqJVqU3tzmKZzof3awfM3HZ6U 3jSuM8bc7f9B8UG1poG/DSKz5VopBU1WkNgAGVuAyJ8iMpwX/dtAbRnKRbYl2LK5MsfLAYteWQ+ez DFzWRuI+9twL3u79ouzZcyXa0ULF+EWaKNsDq3UFBFKqJIMXeFVaGIObnMhMkAJtWCPSBPmoBeay2 eE38Z2JP6nHy1Ywhr2u/CGailfbNIZtAtNzy7VYAVb3DgOS0ZsuUdE9gpIoB/AP2l3m/4pYKezid6 M+rP/85w==; Received: from mail-oa1-f41.google.com ([209.85.160.41]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pae2d-000UZ5-05 for linux-arm-kernel@lists.infradead.org; Fri, 10 Mar 2023 14:48:21 +0000 Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-1763e201bb4so6098011fac.1 for ; Fri, 10 Mar 2023 06:48:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678459697; 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=bIEHlVrmVBM0unFLHI/kdGTckBhGv/jeyiKkRJBBR3A=; b=R+eVgRviYXh6UqS3mDgHNCHYY110EOFI4uItWSOefbK0qFuN6YrlMIGC8X9H343tXS ULae7d5EvOlTVSY1TrqNHqsSnWtEP1PWQJwmfN1qQiSQLpFAsTBusFWzySK4g7SNcXTD 7S4sNKNs8myQQLlT5D7An4ZnDKGsPzapKSu2yj7XSAVVI7tILYyidGNbhevQvzjskT6W bOPHN3HE4R+/Jg5FnlMFSC7xn/e+E4elktQNff9oJbxXYaEASBePOwZ+35H7H8Tmvbtb n3X8kdXicXJlMeUYCCgHs+eXi6M/x7e834BDQQM9albCe9KtrUvXU+glgfR1FPI/4YZq 159Q== X-Gm-Message-State: AO0yUKWgiveFxZkNabt20gQ5bvmWpQZhHrkwXgMDr8n0JxbO0EEBj4Ld F0pbt1V+OmHdg1s7FqdSJBOYD2j8hQ== X-Google-Smtp-Source: AK7set/IS9GrXFd4RG+NEpTXnaefImj6w5XAH+i8hNCc/bshcut01X/HlqJgPkreh+GDTRd2zLI4jQ== X-Received: by 2002:a05:6870:7011:b0:172:21eb:1c2d with SMTP id u17-20020a056870701100b0017221eb1c2dmr17207431oae.31.1678459697083; Fri, 10 Mar 2023 06:48:17 -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 w19-20020a4ae093000000b00524f381f681sm847024oos.27.2023.03.10.06.48.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:48:16 -0800 (PST) Received: (nullmailer pid 1545110 invoked by uid 1000); Fri, 10 Mar 2023 14:47:23 -0000 From: Rob Herring To: Li Yang Cc: devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] soc: fsl: Use of_property_present() for testing DT property presence Date: Fri, 10 Mar 2023 08:47:23 -0600 Message-Id: <20230310144723.1545069-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_144819_208545_E8758905 X-CRM114-Status: GOOD ( 14.45 ) 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/fsl/qbman/dpaa_sys.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/soc/fsl/qbman/dpaa_sys.c b/drivers/soc/fsl/qbman/dpaa_sys.c index 9dd8bb571dbc..33751450047e 100644 --- a/drivers/soc/fsl/qbman/dpaa_sys.c +++ b/drivers/soc/fsl/qbman/dpaa_sys.c @@ -39,8 +39,7 @@ int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr, { struct device_node *mem_node; struct reserved_mem *rmem; - struct property *prop; - int len, err; + int err; __be32 *res_array; mem_node = of_parse_phandle(dev->of_node, "memory-region", idx); @@ -63,8 +62,9 @@ int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr, * This is needed because QBMan HW does not allow the base address/ * size to be modified once set. */ - prop = of_find_property(mem_node, "reg", &len); - if (!prop) { + if (!of_property_present(mem_node, "reg")) { + struct property *prop; + prop = devm_kzalloc(dev, sizeof(*prop), GFP_KERNEL); if (!prop) return -ENOMEM;