From patchwork Tue Mar 28 06:44:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Liu X-Patchwork-Id: 1762175 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=eCKeKSVg; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Pm0Xp4hxmz1yYV for ; Tue, 28 Mar 2023 17:44:42 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2791585BC7; Tue, 28 Mar 2023 08:44:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eCKeKSVg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B1BD185BD0; Tue, 28 Mar 2023 08:44:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AA4C985BC5 for ; Tue, 28 Mar 2023 08:44:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=net147@gmail.com Received: by mail-pj1-x1036.google.com with SMTP id qe8-20020a17090b4f8800b0023f07253a2cso11482002pjb.3 for ; Mon, 27 Mar 2023 23:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679985869; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=gqz+V15flW050Tf1dVaUpboQlde2tn5sJvKux9KG5z4=; b=eCKeKSVgsxRnaVU4Qk+oCodRipn2rIhRTEJF0Br17EXSU6eRJyr+MbYwLiSeDF1DSW q/ui2elkfceNrEr/nGjTnWIeFXb79xoC4MZleF7Kt2yoI1NNhs6iRXQIMDuD3N1p+3Hw O41jClZWmfPStiU/RnMYPn9V3SMJiekpj3MLVy6HXxzqWN+ncjV7DvdE0tNM9BvDlv/I dOPsyLHkV+Aot3NpNnu5qZfoK4F2WQxmg0pU0LrrvXzPrOpVmCJ9rovjzbiWtgSmsuVp 0ke9gQbKuXGxn+1NcyUZZAsyqSO2JxeTZZXG62DYC39bQhykcLZZ10BC02kAyiijYkg8 3FCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679985869; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gqz+V15flW050Tf1dVaUpboQlde2tn5sJvKux9KG5z4=; b=ZyYALKAwppVumPKgxGGyiJbEbOrhJOTFOcKa6n1TiXtDfNP4ZNzx4M+5xKAalHzW5+ yJsRGQIDX2HuuMuAsi3WcqSqnsDmWrtoRyHCY2Q3MZMXLJZZVf/xeKgUF98nfyAtv9zP BjyZxGcQaGxa/sYV1stK610tya8Zxd4E8v3JRF2BTV93NKiYsorBHF0cl1mS1E291rHM TVFrU1Pi2bR3BAbEr48VPsNVo+kClKgyI5tdktiPZkcQuWwAR0YI61ybi98VYAFyH3P1 Az89k9J9YRtKgCJY0k2hhMAvqReyvPNvQ+zJZfAcTAIU6CqhtN9dHqOA+ApYZwDUNOFN cMyg== X-Gm-Message-State: AAQBX9eflBxb1MuNzRJeKSXlmhiMN41KYEkhxueHci0xaCAAJenw9xqC 26SrDks9scq5GfWL6bByge4hti4L3BvWBA== X-Google-Smtp-Source: AKy350bUT1bzcLSuby+fylNvnkbT71TTrwmRXLysZZiKWaSvkjsundPql0XfOlIHRYyMPxzB+2uoDg== X-Received: by 2002:a17:903:22ca:b0:19c:ff35:35d1 with SMTP id y10-20020a17090322ca00b0019cff3535d1mr18873311plg.6.1679985868930; Mon, 27 Mar 2023 23:44:28 -0700 (PDT) Received: from 167-179-157-192.a7b39d.syd.nbn.aussiebb.net (167-179-157-192.a7b39d.syd.nbn.aussiebb.net. [167.179.157.192]) by smtp.gmail.com with ESMTPSA id d3-20020a170902728300b0019c32968271sm20197067pll.11.2023.03.27.23.44.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Mar 2023 23:44:28 -0700 (PDT) From: Jonathan Liu To: Michal Simek , Simon Glass Cc: u-boot@lists.denx.de, Jonathan Liu Subject: [PATCH v2] sysreset: gpio: fix gpio_reboot_request return value Date: Tue, 28 Mar 2023 17:44:23 +1100 Message-Id: <20230328064423.472372-1-net147@gmail.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean It should return -EINPROGRESS if successful otherwise sysreset-uclass will continue to the next sysreset device. Signed-off-by: Jonathan Liu Reviewed-by: Simon Glass Signed-off-by: Jonathan Liu Reviewed-by: Simon Glass --- 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 = {