extcon: max77693: Fix return value
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 8 Apr 2013 00:12:32 +0000 (09:12 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 8 Apr 2013 22:53:46 +0000 (07:53 +0900)
Return the value obtained from the function instead of hardcoding.
Silences the following warnings:
drivers/extcon/extcon-max77693.c:297 max77693_muic_set_path()
info: why not propagate 'ret' from max77693_update_reg() instead of (-11)?
drivers/extcon/extcon-max77693.c:310 max77693_muic_set_path()
info: why not propagate 'ret' from max77693_update_reg() instead of (-11)?

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
drivers/extcon/extcon-max77693.c

index 7b2e93d4f60c74bd375a7c871377ec0f64bbcee9..b56bdaa27d4ba15464c645184b2c18ee2df7e530 100644 (file)
@@ -258,7 +258,7 @@ static int max77693_muic_set_debounce_time(struct max77693_muic_info *info,
                                          CONTROL3_ADCDBSET_MASK);
                if (ret) {
                        dev_err(info->dev, "failed to set ADC debounce time\n");
-                       return -EAGAIN;
+                       return ret;
                }
                break;
        default:
@@ -294,7 +294,7 @@ static int max77693_muic_set_path(struct max77693_muic_info *info,
                        MAX77693_MUIC_REG_CTRL1, ctrl1, COMP_SW_MASK);
        if (ret < 0) {
                dev_err(info->dev, "failed to update MUIC register\n");
-               return -EAGAIN;
+               return ret;
        }
 
        if (attached)
@@ -307,7 +307,7 @@ static int max77693_muic_set_path(struct max77693_muic_info *info,
                        CONTROL2_LOWPWR_MASK | CONTROL2_CPEN_MASK);
        if (ret < 0) {
                dev_err(info->dev, "failed to update MUIC register\n");
-               return -EAGAIN;
+               return ret;
        }
 
        dev_info(info->dev,
@@ -1035,7 +1035,7 @@ static int max77693_muic_detect_accessory(struct max77693_muic_info *info)
        if (ret) {
                dev_err(info->dev, "failed to read MUIC register\n");
                mutex_unlock(&info->mutex);
-               return -EINVAL;
+               return ret;
        }
 
        adc = max77693_muic_get_cable_type(info, MAX77693_CABLE_GROUP_ADC,