twister: Remove dt_compat_enabled_with_alias filter

It has been deprecated since Zephyr v2.6.0.

The filter that replaced it - `dt_enabled_alias_with_parent_compat` -
had shared code with it, which can now be inlined into `ast_expr()` to
match the parser's overall code structure.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
This commit is contained in:
Grzegorz Swiderski 2024-07-08 06:26:39 +02:00 committed by Fabio Baltieri
parent 02045f110c
commit 89bf698d90
1 changed files with 7 additions and 35 deletions

View File

@ -240,30 +240,16 @@ def ast_expr(ast, env, edt):
# Checks if the DT has an enabled alias node whose parent has
# a given compatible. For matching things like gpio-leds child
# nodes, which do not have compatibles themselves.
#
# The legacy "dt_compat_enabled_with_alias" form is still
# accepted but is now deprecated and causes a warning. This is
# meant to give downstream users some time to notice and
# adjust. Its argument order only made sense under the (bad)
# assumption that the gpio-leds child node has the same compatible
alias = ast[1][0]
compat = ast[1][1]
return ast_handle_dt_enabled_alias_with_parent_compat(edt, alias,
compat)
elif ast[0] == "dt_compat_enabled_with_alias":
compat = ast[1][0]
alias = ast[1][1]
_logger.warning('dt_compat_enabled_with_alias("%s", "%s"): '
'this is deprecated, use '
'dt_enabled_alias_with_parent_compat("%s", "%s") '
'instead',
compat, alias, alias, compat)
return ast_handle_dt_enabled_alias_with_parent_compat(edt, alias,
compat)
for node in edt.nodes:
parent = node.parent
if parent is None:
continue
if node.status == "okay" and alias in node.aliases and parent.matching_compat == compat:
return True
return False
elif ast[0] == "dt_label_with_parent_compat_enabled":
compat = ast[1][1]
label = ast[1][0]
@ -286,20 +272,6 @@ def ast_expr(ast, env, edt):
return True
return False
def ast_handle_dt_enabled_alias_with_parent_compat(edt, alias, compat):
# Helper shared with the now deprecated
# dt_compat_enabled_with_alias version.
for node in edt.nodes:
parent = node.parent
if parent is None:
continue
if (node.status == "okay" and alias in node.aliases and
parent.matching_compat == compat):
return True
return False
mutex = threading.Lock()
def parse(expr_text, env, edt):