Commit graph

2 commits

Author SHA1 Message Date
Chris Friedt 83bea9a796 dts: bindings: clean up redundant required false attributes
DTS property attributes are (by default) not required.

Explicitly specifying `required: false` is redundant.
Perhaps a warning to that effect would be useful.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2022-11-20 13:12:44 -05:00
Bernardo Perez Priego 9964414655 include/devicetree.h: Add DT_STRING_TOKEN_OR macro
This macro expands to DT_STRING_TOKEN if property exists, otherwise
falls back to default value.
Helpful when a non-required enum binding doesn't mention a default
value, but a default value makes sense to be set in the code.

Including DT_INST_STRING_TOKEN_OR and test code.

Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
2022-03-10 19:42:59 -08:00