From: Fabio Estevam <festevam@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH 2/2] wandboard: Propagate the error on PMIC function failure
Date: Mon, 9 Dec 2019 21:05:34 -0300 [thread overview]
Message-ID: <20191210000534.993-2-festevam@gmail.com> (raw)
In-Reply-To: <20191210000534.993-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>
---
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
prev parent reply other threads:[~2019-12-10 0:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 0:05 [PATCH 1/2] wandboard: Fix the the DM_PMIC conversion Fabio Estevam
2019-12-10 0:05 ` Fabio Estevam [this message]
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=20191210000534.993-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 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.