* [PATCH v2] sysreset: gpio: fix gpio_reboot_request return value
@ 2023-03-28 6:44 Jonathan Liu
2023-04-01 6:09 ` Simon Glass
0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Liu @ 2023-03-28 6:44 UTC (permalink / raw)
To: Michal Simek, Simon Glass; +Cc: u-boot, Jonathan Liu
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>
---
drivers/sysreset/sysreset_gpio.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
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 = {
--
2.40.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] sysreset: gpio: fix gpio_reboot_request return value
2023-03-28 6:44 [PATCH v2] sysreset: gpio: fix gpio_reboot_request return value Jonathan Liu
@ 2023-04-01 6:09 ` Simon Glass
0 siblings, 0 replies; 2+ messages in thread
From: Simon Glass @ 2023-04-01 6:09 UTC (permalink / raw)
To: Jonathan Liu; +Cc: u-boot, Michal Simek, Simon Glass
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>
---
drivers/sysreset/sysreset_gpio.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Applied to u-boot-dm, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-01 6:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28 6:44 [PATCH v2] sysreset: gpio: fix gpio_reboot_request return value Jonathan Liu
2023-04-01 6:09 ` Simon Glass
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).