Skip to content

Commit

Permalink
zephyr-build: Fix dt node names
Browse files Browse the repository at this point in the history
Fix the DT node names in the generated `dt_cfgs` entries to match the
names of the nodes.  Need to apply `fix_id` in a few places to make sure
non-identifier characters are converted to underscores.

Signed-off-by: David Brown <[email protected]>
  • Loading branch information
d3zd3z committed Oct 19, 2024
1 parent 1e99cea commit 88e3f4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zephyr-build/src/devicetree/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl Node {
writeln!(write, "{}", child_name)?;

for prop in &child.properties {
prop.output_path(write, &child_name)?;
prop.output_path(write, &fix_id(&child_name))?;
}

child.output_path_walk(write, Some(&child_name))?;
Expand All @@ -175,7 +175,7 @@ impl Property {
fn output_path<W: Write>(&self, write: &mut W, name: &str) -> Result<()> {
if let Some(value) = self.get_single_value() {
if let Value::Phandle(_) = value {
writeln!(write, "{}::{}", name, self.name)?;
writeln!(write, "{}::{}", name, fix_id(&self.name))?;
}
}
Ok(())
Expand Down

0 comments on commit 88e3f4f

Please sign in to comment.