Skip to content

Commit 1f1c9ed

Browse files
authored
Merge pull request #108 from zhigang-wu/topic/remove-useless-code1
component: state check should be ahead of state set.
2 parents fd55d5f + 563ab55 commit 1f1c9ed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/audio/component.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ int comp_set_state(struct comp_dev *dev, int cmd)
162162
break;
163163
case COMP_TRIGGER_RESET:
164164
/* reset always succeeds */
165-
dev->state = COMP_STATE_READY;
166165
if (dev->state == COMP_STATE_ACTIVE ||
167166
dev->state == COMP_STATE_PAUSED) {
168167
trace_comp_error("CER");
169168
trace_error_value(dev->state);
170169
ret = 0;
171170
}
171+
dev->state = COMP_STATE_READY;
172172
break;
173173
case COMP_TRIGGER_PREPARE:
174174
if (dev->state == COMP_STATE_PREPARE ||

0 commit comments

Comments
 (0)