Fix for test and devicetree compiler

This commit is contained in:
Ken Van Hoeylandt 2026-06-21 00:18:01 +02:00
parent 65ea551990
commit 8f55942f3e
2 changed files with 5 additions and 2 deletions

View File

@ -20,8 +20,10 @@ def write_define(file, define: DefineC, verbose: bool):
def get_device_node_name_safe(device: Device):
if device.node_name == "/":
return "root"
else:
return device.node_name.replace("-", "_")
name = device.node_name.replace("-", "_")
if device.node_address is not None:
name += "_" + device.node_address.replace("-", "_")
return name
def get_device_type_name(device: Device, bindings: list[Binding]):
device_binding = find_device_binding(device, bindings)

View File

@ -10,6 +10,7 @@ static const root_config_dt root_config = {
};
static struct Device root = {
.address = 0,
.name = "/",
.config = &root_config,
.parent = NULL,