Skip to content

Commit e9eadc2

Browse files
robherringvireshk
authored andcommitted
opp: 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: Viresh Kumar <viresh.kumar@linaro.org>
1 parent fe15c26 commit e9eadc2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/opp/of.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void _of_init_opp_table(struct opp_table *opp_table, struct device *dev,
224224
of_property_read_u32(np, "voltage-tolerance",
225225
&opp_table->voltage_tolerance_v1);
226226

227-
if (of_find_property(np, "#power-domain-cells", NULL))
227+
if (of_property_present(np, "#power-domain-cells"))
228228
opp_table->is_genpd = true;
229229

230230
/* Get OPP table node */
@@ -536,7 +536,7 @@ static bool _opp_is_supported(struct device *dev, struct opp_table *opp_table,
536536
* an OPP then the OPP should not be enabled as there is
537537
* no way to see if the hardware supports it.
538538
*/
539-
if (of_find_property(np, "opp-supported-hw", NULL))
539+
if (of_property_present(np, "opp-supported-hw"))
540540
return false;
541541
else
542542
return true;

0 commit comments

Comments
 (0)