Skip to content

Commit

Permalink
mfd: max77843: Fix max77843_chg_init() return on error
Browse files Browse the repository at this point in the history
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: c7f585f ("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>
  • Loading branch information
Javier Martinez Canillas authored and Lee Jones committed Oct 1, 2015
1 parent 47b9192 commit 1b52e50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mfd/max77843.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 1b52e50

Please sign in to comment.