Skip to content

base: phandle_safe_name: replace all invalid label characters#766

Merged
zeddii merged 1 commit into
devicetree-org:masterfrom
Rajukumar45:master
May 25, 2026
Merged

base: phandle_safe_name: replace all invalid label characters#766
zeddii merged 1 commit into
devicetree-org:masterfrom
Rajukumar45:master

Conversation

@Rajukumar45

Copy link
Copy Markdown
Contributor

DTS labels must be valid C identifiers ([a-zA-Z_][a-zA-Z0-9_]*), but node names can contain characters from the set [0-9a-zA-Z,._+-].

Previously, phandle_safe_name() only replaced '@', '-', and '/'. This left ',' , '.' and '+' in the generated label, producing invalid DTS output (e.g., "pcie0,0:" for node pcie@0,0).

Add replacements for ',', '.', and '+' so that all non-identifier characters in node names are converted to '_'.

DTS labels must be valid C identifiers ([a-zA-Z_][a-zA-Z0-9_]*),
but node names can contain characters from the set [0-9a-zA-Z,._+-].

Previously, phandle_safe_name() only replaced '@', '-',
and '/'. This left ',' , '.' and '+' in the generated label,
producing invalid DTS output (e.g., "pcie0,0:" for node pcie@0,0).

Add replacements for ',', '.', and '+' so that all non-identifier
characters in node names are converted to '_'.

Signed-off-by: Raju Kumar Pothuraju <rajukumar.pothuraju@amd.com>
@zeddii zeddii merged commit 6c66fe5 into devicetree-org:master May 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants