mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
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:
parent
87dac6b074
commit
9072326a6a
2 changed files with 2 additions and 0 deletions
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue