From patchwork Fri Mar 10 14:47:36 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: 13169529 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 CBC71C6FD1F for ; Fri, 10 Mar 2023 16:04:37 +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=Dg2S4sAbJ6+th6PR7ZVDzEDIstp50XlmcyrdX9mNW/U=; b=ibaSY+6HcIvNUQ pqE6ZY9d1rUzlwWtefdR12lq24A8kGVelReuDlH5gNF3PF4mx9MyWXrYIb6zap8A1PRocQsIb7chY IerLhqeIsqO3un1w5jaDJ2QFe3l1OBpWsdjzUgIV4B9PZy7rWLTnnqnmqnbJNXUh2v3Z8rwksF8HQ T9h5bVuFWJN0k1xVfbKkbz5T6iUknsmgmTeNjSvxLIylzq+WFtWuxztLhDXb69QZb6Kpuy3lnJi7w wwrpvwAUqrkM+7ZUm8bHgqjkgF2o/qtA2VPBlNwIpnKwVUubIF9+OTm0JZJejbVtdBjxTFVG+91Za EdlY6jBUawPGMR2gNDBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pafDb-00FBGj-LS; Fri, 10 Mar 2023 16:03:44 +0000 Received: from mail-oa1-f41.google.com ([209.85.160.41]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pae2B-00EmrG-QO for linux-arm-kernel@lists.infradead.org; Fri, 10 Mar 2023 14:47:53 +0000 Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-176e43eb199so6064847fac.7 for ; Fri, 10 Mar 2023 06:47:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678459670; 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=72GZ6tt+NtMByXBprOsf1R5lfkGwkm3Xw8kwN9b+yWo=; b=D1lJRLgucaHaUV+hRJG+heCSyg9ONbwvfi4aMxkrKvHGeT19DIiD0Rf2opkgAf/Y36 kMTPt+ALRZWI3puPeKNN6d1z5DJvC3uebaDT7fTCPaWvR7Op7utkCyKSyX7T5eNWJySl avPVVcF/xGRd8F+Iiigi380utNNXntFfFwsJvw/n8i0Bca8kSKmru2WvT4jCXpNaW0CD 4Xb+1cMKGNPxaKW4ncoWRZGeFi2kaCDwH7tJPNaRhiyrbx0N8uMGkD2S6Xl6p1Aimbj/ ens3gabEJjycSffShCigN+ShJTC6XS66uBLt+iS3ECOI/pvt+mP3jCzdMrb/6l6T1ctP iBvw== X-Gm-Message-State: AO0yUKXKNz7aTGc4DEXa8TYMQYBYOWYcH/pD7LeBy0/cagsgLW9rhe/F 1n4ZwHAlhjOxz4UHKHYw2A== X-Google-Smtp-Source: AK7set9JuJayVFavWfSPxdB9MZVNOuRYl8Z6r6VhwjgRJ6ZHv32dVupXnUJFExVxqSPdm4Mkjz4oFw== X-Received: by 2002:a05:6870:e886:b0:15e:c4e1:c9fb with SMTP id q6-20020a056870e88600b0015ec4e1c9fbmr5624135oan.31.1678459670465; Fri, 10 Mar 2023 06:47:50 -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 o20-20020a9d7194000000b0068657984c22sm124712otj.32.2023.03.10.06.47.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:47:50 -0800 (PST) Received: (nullmailer pid 1547067 invoked by uid 1000); Fri, 10 Mar 2023 14:47:36 -0000 From: Rob Herring To: Alessandro Zummo , Alexandre Belloni , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: devicetree@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] rtc: sun6i: Use of_property_present() for testing DT property presence Date: Fri, 10 Mar 2023 08:47:36 -0600 Message-Id: <20230310144736.1547041-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_064751_893417_1A24CDDB X-CRM114-Status: GOOD ( 15.53 ) 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: Andre Przywara Reviewed-by: Jernej Skrabec --- drivers/rtc/rtc-sun6i.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index 7038f47d77ff..dc76537f1b62 100644 --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c @@ -260,7 +260,7 @@ static void __init sun6i_rtc_clk_init(struct device_node *node, } /* Switch to the external, more precise, oscillator, if present */ - if (of_get_property(node, "clocks", NULL)) { + if (of_property_present(node, "clocks")) { reg |= SUN6I_LOSC_CTRL_EXT_OSC; if (rtc->data->has_losc_en) reg |= SUN6I_LOSC_CTRL_EXT_LOSC_EN;