From: Fabio Estevam <festevam@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 2/3] wandboard: Propagate the error on PMIC function failure
Date: Mon, 9 Dec 2019 21:20:40 -0300 [thread overview]
Message-ID: <20191210002041.3388-2-festevam@gmail.com> (raw)
In-Reply-To: <20191210002041.3388-1-festevam@gmail.com>
When pmic_get() or pmic_reg_read() fail, the error code should
be propagated instead of returning success.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v1:
- None
board/wandboard/wandboard.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/board/wandboard/wandboard.c b/board/wandboard/wandboard.c
index b2f961a7f0..7209cc8211 100644
--- a/board/wandboard/wandboard.c
+++ b/board/wandboard/wandboard.c
@@ -366,13 +366,13 @@ int power_init_board(void)
ret = pmic_get("pfuze100 at 8", &dev);
if (ret < 0) {
printf("pmic_get() ret %d\n", ret);
- return 0;
+ return ret;
}
reg = pmic_reg_read(dev, PFUZE100_DEVICEID);
if (reg < 0) {
printf("pmic_reg_read() ret %d\n", reg);
- return 0;
+ return ret;
}
printf("PMIC: PFUZE100 ID=0x%02x\n", reg);
with_pmic = true;
--
2.17.1
next prev parent reply other threads:[~2019-12-10 0:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 0:20 [PATCH v2 1/3] wandboard: Fix the DM_PMIC conversion Fabio Estevam
2019-12-10 0:20 ` Fabio Estevam [this message]
2019-12-10 9:31 ` [PATCH v2 2/3] wandboard: Propagate the error on PMIC function failure Fabio Estevam
2019-12-10 0:20 ` [PATCH v2 3/3] wandboard: Remove repeated PMIC string Fabio Estevam
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=20191210002041.3388-2-festevam@gmail.com \
--to=festevam@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox