u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Jonathan Liu <net147@gmail.com>
To: Michal Simek <michal.simek@amd.com>, Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, Jonathan Liu <net147@gmail.com>
Subject: [PATCH v2] sysreset: gpio: fix gpio_reboot_request return value
Date: Tue, 28 Mar 2023 17:44:23 +1100	[thread overview]
Message-ID: <20230328064423.472372-1-net147@gmail.com> (raw)

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


             reply	other threads:[~2023-03-28  6:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28  6:44 Jonathan Liu [this message]
2023-04-01  6:09 ` [PATCH v2] sysreset: gpio: fix gpio_reboot_request return value Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230328064423.472372-1-net147@gmail.com \
    --to=net147@gmail.com \
    --cc=michal.simek@amd.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).