summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-03-15 10:56:04 (GMT)
committerChanwoo Choi <cw00.choi@samsung.com>2015-03-23 01:50:27 (GMT)
commitb9b518f53996b67833b42ca7751b2085b0dc565a (patch)
tree101093ee28154ce1312c976f7b2fff8bf351696c /drivers
parentd927c59076f505a056e78a9fc9744069aa052cc8 (diff)
downloadlinux-b9b518f53996b67833b42ca7751b2085b0dc565a.tar.xz
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/extcon/extcon-max77843.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c
index a3f80ca..8db6a92 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)
if (!max77843->i2c_muic) {
dev_err(&max77843->i2c->dev,
"Cannot allocate I2C device for MUIC\n");
- return PTR_ERR(max77843->i2c_muic);
+ return -ENOMEM;
}
i2c_set_clientdata(max77843->i2c_muic, max77843);