Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ad9e86d authored by Sachin Kamat's avatar Sachin Kamat Committed by Chanwoo Choi
Browse files

extcon: max8997: Fix return value



Return the value obtained from the function instead of hardcoding.
Fixes the following warnings:
drivers/extcon/extcon-max8997.c:235 max8997_muic_set_path() info:
why not propagate 'ret' from max8997_update_reg() instead of (-11)?
drivers/extcon/extcon-max8997.c:248 max8997_muic_set_path() info:
why not propagate 'ret' from max8997_update_reg() instead of (-11)?

Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: default avatarMyungjoo Ham <myungjoo.ham@samsung.com>
parent c2536543
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -196,7 +196,7 @@ static int max8997_muic_set_debounce_time(struct max8997_muic_info *info,
					  CONTROL3_ADCDBSET_MASK);
					  CONTROL3_ADCDBSET_MASK);
		if (ret) {
		if (ret) {
			dev_err(info->dev, "failed to set ADC debounce time\n");
			dev_err(info->dev, "failed to set ADC debounce time\n");
			return -EAGAIN;
			return ret;
		}
		}
		break;
		break;
	default:
	default:
@@ -232,7 +232,7 @@ static int max8997_muic_set_path(struct max8997_muic_info *info,
			MAX8997_MUIC_REG_CONTROL1, ctrl1, COMP_SW_MASK);
			MAX8997_MUIC_REG_CONTROL1, ctrl1, COMP_SW_MASK);
	if (ret < 0) {
	if (ret < 0) {
		dev_err(info->dev, "failed to update MUIC register\n");
		dev_err(info->dev, "failed to update MUIC register\n");
		return -EAGAIN;
		return ret;
	}
	}


	if (attached)
	if (attached)
@@ -245,7 +245,7 @@ static int max8997_muic_set_path(struct max8997_muic_info *info,
			CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK);
			CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK);
	if (ret < 0) {
	if (ret < 0) {
		dev_err(info->dev, "failed to update MUIC register\n");
		dev_err(info->dev, "failed to update MUIC register\n");
		return -EAGAIN;
		return ret;
	}
	}


	dev_info(info->dev,
	dev_info(info->dev,
@@ -397,7 +397,7 @@ static int max8997_muic_handle_jig_uart(struct max8997_muic_info *info,
	ret = max8997_muic_set_path(info, info->path_uart, attached);
	ret = max8997_muic_set_path(info, info->path_uart, attached);
	if (ret) {
	if (ret) {
		dev_err(info->dev, "failed to update muic register\n");
		dev_err(info->dev, "failed to update muic register\n");
		return -EINVAL;
		return ret;
	}
	}


	extcon_set_cable_state(info->edev, "JIG", attached);
	extcon_set_cable_state(info->edev, "JIG", attached);
@@ -608,7 +608,7 @@ static int max8997_muic_detect_dev(struct max8997_muic_info *info)
	if (ret) {
	if (ret) {
		dev_err(info->dev, "failed to read MUIC register\n");
		dev_err(info->dev, "failed to read MUIC register\n");
		mutex_unlock(&info->mutex);
		mutex_unlock(&info->mutex);
		return -EINVAL;
		return ret;
	}
	}


	adc = max8997_muic_get_cable_type(info, MAX8997_CABLE_GROUP_ADC,
	adc = max8997_muic_get_cable_type(info, MAX8997_CABLE_GROUP_ADC,