diff options
author | Jonathan Liu <net147@gmail.com> | 2023-03-28 17:44:23 +1100 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2023-03-31 08:32:52 +1300 |
commit | a47164dfc1ef899ef9ddc6d8f2a17f0e9e90ef34 (patch) | |
tree | 2be8e2916284f13f29cda0f75c01eeeb3ffad485 | |
parent | 49d8cc4cbe18c7ffdc7e9699b9b64545288ecb1f (diff) |
sysreset: gpio: fix gpio_reboot_request return value
It should return -EINPROGRESS if successful otherwise sysreset-uclass
will continue to the next sysreset device.
Signed-off-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | drivers/sysreset/sysreset_gpio.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/sysreset/sysreset_gpio.c b/drivers/sysreset/sysreset_gpio.c index dfca10ccc8..de42b59354 100644 --- a/drivers/sysreset/sysreset_gpio.c +++ b/drivers/sysreset/sysreset_gpio.c @@ -17,6 +17,7 @@ struct gpio_reboot_priv { static int gpio_reboot_request(struct udevice *dev, enum sysreset_t type) { struct gpio_reboot_priv *priv = dev_get_priv(dev); + int ret; /* * When debug log is enabled please make sure that chars won't end up @@ -26,7 +27,11 @@ static int gpio_reboot_request(struct udevice *dev, enum sysreset_t type) debug("GPIO reset\n"); /* Writing 1 respects polarity (active high/low) based on gpio->flags */ - return dm_gpio_set_value(&priv->gpio, 1); + ret = dm_gpio_set_value(&priv->gpio, 1); + if (ret < 0) + return ret; + + return -EINPROGRESS; } static struct sysreset_ops gpio_reboot_ops = { |