Skip to content
Permalink
Browse files

scripts: extract: globals.py: fix node name when it includes "@"

In some cases, node label could be generated with "/" character
in name string, which prevents compilation

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
  • Loading branch information...
erwango authored and galak committed Feb 23, 2018
1 parent 18f24f0 commit ad29ec69dd935bc24249338bf83d457e28d4cdf9
Showing with 4 additions and 2 deletions.
  1. +4 −2 scripts/dts/extract/globals.py
@@ -29,10 +29,11 @@


def convert_string_to_label(s):
# Transmute ,-@ to _
# Transmute ,-@/ to _
s = s.replace("-", "_")
s = s.replace(",", "_")
s = s.replace("@", "_")
s = s.replace("/", "_")
# Uppercase the string
s = s.upper()
return s
@@ -155,7 +156,8 @@ def get_reduced(nodes, path):
def get_node_label(node_compat, node_address):
def_label = convert_string_to_label(node_compat)
if '@' in node_address:
def_label += '_' + node_address.split('@')[-1].upper()
def_label += '_' + \
convert_string_to_label(node_address.split('@')[-1])
else:
def_label += convert_string_to_label(node_address)

0 comments on commit ad29ec6

Please sign in to comment.
You can’t perform that action at this time.