sandbox: Exit when SYSRESET_POWER_OFF is requested

At present this returns but it seems better to just exit sandbox
immediately.

Signed-off-by: Simon Glass <sjg@chromium.org>

reset
This commit is contained in:
Simon Glass 2019-05-18 11:59:43 -06:00
parent 87dac6b074
commit 9072326a6a
2 changed files with 2 additions and 0 deletions

View file

@ -356,6 +356,7 @@ void state_reset_for_test(struct sandbox_state *state)
/* No reset yet, so mark it as such. Always allow power reset */
state->last_sysreset = SYSRESET_COUNT;
state->sysreset_allowed[SYSRESET_POWER] = true;
state->sysreset_allowed[SYSRESET_POWER_OFF] = true;
memset(&state->wdt, '\0', sizeof(state->wdt));
memset(state->spi, '\0', sizeof(state->spi));

View file

@ -66,6 +66,7 @@ static int sandbox_sysreset_request(struct udevice *dev, enum sysreset_t type)
case SYSRESET_POWER_OFF:
if (!state->sysreset_allowed[type])
return -EACCES;
sandbox_exit();
default:
return -ENOSYS;
}