diff options
author | Javier Martinez Canillas <javier@osg.samsung.com> | 2015-09-21 15:26:54 +0300 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2015-10-01 18:31:42 +0300 |
commit | 1b52e50f2a402a266f1ba2281f0a57e87637a047 (patch) | |
tree | 1a944e6f9d25779dd34684e58a13208ff3fd20ca /drivers/mfd | |
parent | 47b91923ea41288751e83a5b080576085a831333 (diff) | |
download | linux-1b52e50f2a402a266f1ba2281f0a57e87637a047.tar.xz |
mfd: max77843: Fix max77843_chg_init() return on error
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.
Cc: stable@vger.kernel.org # 4.1
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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/max77843.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mfd/max77843.c b/drivers/mfd/max77843.c index c52162ea3d0a..586098f1b233 100644 --- a/drivers/mfd/max77843.c +++ b/drivers/mfd/max77843.c @@ -80,7 +80,7 @@ static int max77843_chg_init(struct max77693_dev *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); |