regulator: fix simple_return.cocci warnings
authorJulia Lawall <julia.lawall@lip6.fr>
Tue, 16 Jun 2015 13:45:14 +0000 (06:45 -0700)
committerMark Brown <broonie@kernel.org>
Tue, 16 Jun 2015 14:58:53 +0000 (15:58 +0100)
Simplify a trivial if-return sequence and combine with a
preceding function call.

Generated by: scripts/coccinelle/misc/simple_return.cocci

CC: Mark Brown <broonie@kernel.org>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/qcom_spmi-regulator.c

index 162b86501a917b2c96fc4371bb9a08e610295e62..15bba2b4ef70d634572947531eb40f6585fc5239 100644 (file)
@@ -710,12 +710,8 @@ static int spmi_regulator_ult_lo_smps_set_voltage(struct regulator_dev *rdev,
        if (range_sel == 1)
                voltage_sel |= ULT_SMPS_RANGE_SPLIT;
 
-       ret = spmi_vreg_update_bits(vreg, SPMI_COMMON_REG_VOLTAGE_SET,
+       return spmi_vreg_update_bits(vreg, SPMI_COMMON_REG_VOLTAGE_SET,
               voltage_sel, 0xff);
-       if (ret)
-               return ret;
-
-       return 0;
 }
 
 static int spmi_regulator_ult_lo_smps_get_voltage(struct regulator_dev *rdev)