sysreset: watchdog: watchdog cannot power off

The watchdog system reset driver can reboot the device but it cannot power
it off. If power off is requested, the driver should not reset the system
but leave powering off to one of the other system reset drivers.

As power cycling is typically not a feature of a watchdog driver the reset
types SYSRESET_POWER and SYSRESET_POWER_OFF shall both be excluded.

Fixes: 17a0c14164 ("dm: sysreset: add watchdog-reboot driver")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
Heinrich Schuchardt 2021-11-04 10:31:17 +01:00
parent 2b18d95d91
commit 88c4cbedfb

View File

@ -20,9 +20,16 @@ static int wdt_reboot_request(struct udevice *dev, enum sysreset_t type)
struct wdt_reboot_plat *plat = dev_get_plat(dev);
int ret;
ret = wdt_expire_now(plat->wdt, 0);
if (ret)
return ret;
switch (type) {
case SYSRESET_COLD:
case SYSRESET_WARM:
ret = wdt_expire_now(plat->wdt, 0);
if (ret)
return ret;
break;
default:
return -ENOSYS;
}
return -EINPROGRESS;
}