summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier@osg.samsung.com>2015-09-21 14:26:54 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-27 09:51:55 +0900
commitb6af04a2106867e49fa1351bf7ab7426a8c2b63c (patch)
treedb5f277c63842ee1020f99b64ca575165e774410 /drivers/mfd
parent271759afb5a49f1d1e5a3cef5c0fdec867f9bba4 (diff)
mfd: max77843: Fix max77843_chg_init() return on error
commit 1b52e50f2a402a266f1ba2281f0a57e87637a047 upstream. If i2c_new_dummy() fails in max77843_chg_init(), an PTR_ERR(NULL) is returned which is 0. So the function was wrongly returning a success value instead of an error code. Fixes: c7f585fe46d8 ("mfd: max77843: Add max77843 MFD driver core driver") Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/max77843.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/max77843.c b/drivers/mfd/max77843.c
index a354ac677ec7..1074a0d68680 100644
--- a/drivers/mfd/max77843.c
+++ b/drivers/mfd/max77843.c
@@ -79,7 +79,7 @@ static int max77843_chg_init(struct max77843 *max77843)
if (!max77843->i2c_chg) {
dev_err(&max77843->i2c->dev,
"Cannot allocate I2C device for Charger\n");
- return PTR_ERR(max77843->i2c_chg);
+ return -ENODEV;
}
i2c_set_clientdata(max77843->i2c_chg, max77843);