Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9a38eda authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "of: Generate warnings for malformed boolean properties"

parents a7ec2e7a 4ecd31a0
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -544,6 +544,16 @@ static inline bool of_property_read_bool(const struct device_node *np,
{
	struct property *prop = of_find_property(np, propname, NULL);

	/*
	 * Boolean properties have no value cells. The "value" of a boolean
	 * property is determined by the presence or absence of the property
	 * itself, and value cells are disregarded entirely. Declaring a
	 * boolean property with a nonzero number of value cells is a common
	 * configuration error, since even a boolean property having a value of
	 * 0 will be treated as "true" by the DT framework.
	 */
	WARN_ON(prop && prop->length);

	return prop ? true : false;
}