- if (((walk_state->parse_flags & ACPI_PARSE_TREE_MASK) == ACPI_PARSE_DELETE_TREE) &&
- (walk_state->op_info->class != AML_CLASS_ARGUMENT)) {
- /* Make sure that we only delete this subtree */
+ if (((walk_state->parse_flags & ACPI_PARSE_TREE_MASK) != ACPI_PARSE_DELETE_TREE) ||
+ (walk_state->op_info->class == AML_CLASS_ARGUMENT)) {
+ return_VOID;
+ }
+
+ /* Make sure that we only delete this subtree */
+
+ if (op->common.parent) {
+ /*
+ * Check if we need to replace the operator and its subtree
+ * with a return value op (placeholder op)
+ */
+ parent_info = acpi_ps_get_opcode_info (op->common.parent->common.aml_opcode);
+
+ switch (parent_info->class) {
+ case AML_CLASS_CONTROL:
+ break;
+
+ case AML_CLASS_CREATE: