diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-03-15 06:56:04 -0400 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2015-03-22 21:50:27 -0400 |
commit | b9b518f53996b67833b42ca7751b2085b0dc565a (patch) | |
tree | 101093ee28154ce1312c976f7b2fff8bf351696c | |
parent | d927c59076f505a056e78a9fc9744069aa052cc8 (diff) |
extcon: max77843: Fix an error code in max77843_init_muic_regmap()
The i2c_new_dummy() return the NULL if error happen. So, If i2c_new_dummy()
return NULL, max77843_init_muic_regmap() return the proper error value
(-ENOMEM);
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[cw00.choi: Use -ENOMEM instead of -ENODEV and modify patch description]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
-rw-r--r-- | drivers/extcon/extcon-max77843.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c index a3f80ca4a6e3..8db6a926ea07 100644 --- a/drivers/extcon/extcon-max77843.c +++ b/drivers/extcon/extcon-max77843.c | |||
@@ -715,7 +715,7 @@ static int max77843_init_muic_regmap(struct max77843 *max77843) | |||
715 | if (!max77843->i2c_muic) { | 715 | if (!max77843->i2c_muic) { |
716 | dev_err(&max77843->i2c->dev, | 716 | dev_err(&max77843->i2c->dev, |
717 | "Cannot allocate I2C device for MUIC\n"); | 717 | "Cannot allocate I2C device for MUIC\n"); |
718 | return PTR_ERR(max77843->i2c_muic); | 718 | return -ENOMEM; |
719 | } | 719 | } |
720 | 720 | ||
721 | i2c_set_clientdata(max77843->i2c_muic, max77843); | 721 | i2c_set_clientdata(max77843->i2c_muic, max77843); |