dts: edtlib: Simplify 'category: optional' code in Device._prop_val()

Reuse Device.enabled().

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2019-08-08 21:32:57 +02:00 committed by Kumar Gala
commit f7f0e0adf9

View file

@ -578,10 +578,7 @@ class Device:
prop = node.props.get(name)
if not prop:
if not optional and \
("status" not in node.props or
node.props["status"].to_string() != "disabled"):
if not optional and self.enabled:
_err("'{}' is marked as required in 'properties:' in {}, but "
"does not appear in {!r}".format(
name, self.binding_path, node))