Skip to content

Commit 1b1b863

Browse files
robherringnmenon
authored andcommitted
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 <[email protected]> Signed-off-by: Nishanth Menon <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8f3c307 commit 1b1b863

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/soc/ti/knav_qmss_queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,7 @@ static int knav_setup_queue_range(struct knav_device *kdev,
12671267
if (of_get_property(node, "qalloc-by-id", NULL))
12681268
range->flags |= RANGE_RESERVED;
12691269

1270-
if (of_get_property(node, "accumulator", NULL)) {
1270+
if (of_property_present(node, "accumulator")) {
12711271
ret = knav_init_acc_range(kdev, node, range);
12721272
if (ret < 0) {
12731273
devm_kfree(dev, range);

drivers/soc/ti/omap_prm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ static int omap_prm_domain_init(struct device *dev, struct omap_prm *prm)
684684
const char *name;
685685
int error;
686686

687-
if (!of_find_property(dev->of_node, "#power-domain-cells", NULL))
687+
if (!of_property_present(dev->of_node, "#power-domain-cells"))
688688
return 0;
689689

690690
of_node_put(dev->of_node);

0 commit comments

Comments
 (0)