* [PATCH] regulator: wm831x-ldo: Check return value of wm831x_reg_read()
@ 2012-07-31 13:28 Axel Lin
2012-08-01 20:02 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-07-31 13:28 UTC (permalink / raw)
To: Mark Brown; +Cc: Liam Girdwood, linux-kernel
wm831x_reg_read() returns negative error code on failure.
This prevents using the error code as the value read.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/regulator/wm831x-ldo.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c
index 5cb70ca..56a6de3 100644
--- a/drivers/regulator/wm831x-ldo.c
+++ b/drivers/regulator/wm831x-ldo.c
@@ -205,6 +205,8 @@ static int wm831x_gp_ldo_get_status(struct regulator_dev *rdev)
/* Is it reporting under voltage? */
ret = wm831x_reg_read(wm831x, WM831X_LDO_UV_STATUS);
+ if (ret < 0)
+ return ret;
if (ret & mask)
return REGULATOR_STATUS_ERROR;
@@ -469,6 +471,8 @@ static int wm831x_aldo_get_status(struct regulator_dev *rdev)
/* Is it reporting under voltage? */
ret = wm831x_reg_read(wm831x, WM831X_LDO_UV_STATUS);
+ if (ret < 0)
+ return ret;
if (ret & mask)
return REGULATOR_STATUS_ERROR;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] regulator: wm831x-ldo: Check return value of wm831x_reg_read()
2012-07-31 13:28 [PATCH] regulator: wm831x-ldo: Check return value of wm831x_reg_read() Axel Lin
@ 2012-08-01 20:02 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2012-08-01 20:02 UTC (permalink / raw)
To: Axel Lin; +Cc: Liam Girdwood, linux-kernel
On Tue, Jul 31, 2012 at 09:28:26PM +0800, Axel Lin wrote:
> wm831x_reg_read() returns negative error code on failure.
> This prevents using the error code as the value read.
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-01 20:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-31 13:28 [PATCH] regulator: wm831x-ldo: Check return value of wm831x_reg_read() Axel Lin
2012-08-01 20:02 ` Mark Brown
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.