All of lore.kernel.org
 help / color / mirror / Atom feed
From: qianfanguijin@qq.com
To: sean.anderson@seco.com, u-boot@lists.denx.de
Cc: qianfan Zhao <qianfanguijin@163.com>
Subject: [PATCH v1] driver: fastboot: Fix getvar_get_part_info when flash nand
Date: Wed, 29 Dec 2021 10:50:50 +0800	[thread overview]
Message-ID: <tencent_B8C6B1D4726A0B7C63D5FC9A01D688D1EB08@qq.com> (raw)

From: qianfan Zhao <qianfanguijin@163.com>

find_dev_and_part return 0 on success, 1 otherwise.
So fastboot_nand_get_part_info follow this rule.

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
---
 drivers/fastboot/fb_getvar.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/fastboot/fb_getvar.c b/drivers/fastboot/fb_getvar.c
index d43f2cfee6..a7a8dc458f 100644
--- a/drivers/fastboot/fb_getvar.c
+++ b/drivers/fastboot/fb_getvar.c
@@ -114,7 +114,10 @@ static int getvar_get_part_info(const char *part_name, char *response,
 	struct part_info *part_info;
 
 	r = fastboot_nand_get_part_info(part_name, &part_info, response);
-	if (r >= 0 && size)
+
+	if (r) /* find nand device and part failed */
+		r = -ENODEV;
+	else if (size)
 		*size = part_info->size;
 # else
 	fastboot_fail("this storage is not supported in bootloader", response);
-- 
2.17.1


             reply	other threads:[~2021-12-29  2:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-29  2:50 qianfanguijin [this message]
2022-01-27 15:06 ` [PATCH v1] driver: fastboot: Fix getvar_get_part_info when flash nand Simon Glass
2022-01-27 16:56 ` Sean Anderson

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=tencent_B8C6B1D4726A0B7C63D5FC9A01D688D1EB08@qq.com \
    --to=qianfanguijin@qq.com \
    --cc=qianfanguijin@163.com \
    --cc=sean.anderson@seco.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.