diff --git a/scripts/pylib/twister/expr_parser.py b/scripts/pylib/twister/expr_parser.py index 5fbf54230c6..e77d104bc60 100644 --- a/scripts/pylib/twister/expr_parser.py +++ b/scripts/pylib/twister/expr_parser.py @@ -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):