Skip to content

Commit 8379fec

Browse files
committed
zephyr-build: Only generate nodes that are enabled
Don't generate instance access code for DT nodes that aren't actually enabled. Signed-off-by: David Brown <[email protected]>
1 parent 142012e commit 8379fec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

zephyr-build/src/devicetree/augment.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ pub trait Augment {
2828
/// The default implementation checks if this node matches and calls a generator if it does, or
2929
/// does nothing if not.
3030
fn augment(&self, node: &Node, tree: &DeviceTree) -> TokenStream {
31+
// If there is a status field present, and it is not set to "okay", don't augment this node.
32+
if let Some(status) = node.get_single_string("status") {
33+
if status != "okay" {
34+
return TokenStream::new();
35+
}
36+
}
3137
if self.is_compatible(node) {
3238
self.generate(node, tree)
3339
} else {

0 commit comments

Comments
 (0)