浏览代码

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>
Dan Carpenter 10 年之前
父节点
当前提交
b9b518f539
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/extcon/extcon-max77843.c

+ 1 - 1
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);