soc: ti: Use of_property_present() for testing DT property presence

It is preferred to use typed property access functions (i.e.
of_property_read_<type> 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 <robh@kernel.org>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/20230310144725.1545384-1-robh@kernel.org
This commit is contained in:
Rob Herring 2023-03-10 08:47:25 -06:00 committed by Nishanth Menon
parent 8f3c307b58
commit 1b1b863a88
2 changed files with 2 additions and 2 deletions

View File

@ -1267,7 +1267,7 @@ static int knav_setup_queue_range(struct knav_device *kdev,
if (of_get_property(node, "qalloc-by-id", NULL))
range->flags |= RANGE_RESERVED;
if (of_get_property(node, "accumulator", NULL)) {
if (of_property_present(node, "accumulator")) {
ret = knav_init_acc_range(kdev, node, range);
if (ret < 0) {
devm_kfree(dev, range);

View File

@ -684,7 +684,7 @@ static int omap_prm_domain_init(struct device *dev, struct omap_prm *prm)
const char *name;
int error;
if (!of_find_property(dev->of_node, "#power-domain-cells", NULL))
if (!of_property_present(dev->of_node, "#power-domain-cells"))
return 0;
of_node_put(dev->of_node);