diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-10-25 15:43:44 +0300 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2019-05-02 23:41:10 +0300 |
commit | a7a46eeccda2af066f1aa10f42da6a08a98084b5 (patch) | |
tree | 9f2bfa31dd90dee0d027e1c0cb120dacda998c9f | |
parent | db7d8a82d1e8be8bf2e9acaf4d543e33d7da5d70 (diff) | |
download | linux-a7a46eeccda2af066f1aa10f42da6a08a98084b5.tar.xz |
mfd: ab8500-core: Return zero in get_register_interruptible()
commit 10628e3ecf544fa2e4e24f8e112d95c37884dc98 upstream.
This function is supposed to return zero on success or negative error
codes on error. Unfortunately, there is a bug so it sometimes returns
non-zero, positive numbers on success.
I noticed this bug during review and I can't test it. It does appear
that the return is sometimes propogated back to _regmap_read() where all
non-zero returns are treated as failure so this may affect run time.
Fixes: 47c1697508f2 ("mfd: Align ab8500 with the abx500 interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | drivers/mfd/ab8500-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index cf2e6a198c6b..798d5a1c2119 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -259,7 +259,7 @@ static int get_register_interruptible(struct ab8500 *ab8500, u8 bank, mutex_unlock(&ab8500->lock); dev_vdbg(ab8500->dev, "rd: addr %#x => data %#x\n", addr, ret); - return ret; + return (ret < 0) ? ret : 0; } static int ab8500_get_register(struct device *dev, u8 bank, |