diff options
author | 2022-01-04 10:41:39 +0000 | |
---|---|---|
committer | 2022-01-04 15:00:39 +0000 | |
commit | 1f156b4285865dc2eb66e7a78c7ba80c17bb2b0a (patch) | |
tree | ab264ecafb7ebaacb81149a3c4cca100bb2a0b83 /drivers/regulator | |
parent | regulator: qcom-labibb: OCP interrupts are not a failure while disabled (diff) | |
download | linux-1f156b4285865dc2eb66e7a78c7ba80c17bb2b0a.tar.gz linux-1f156b4285865dc2eb66e7a78c7ba80c17bb2b0a.tar.bz2 linux-1f156b4285865dc2eb66e7a78c7ba80c17bb2b0a.zip |
regulator: remove redundant ret variable
Return value from regmap_update_bits() directly instead
of taking this in another redundant variable.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
Link: https://lore.kernel.org/r/20220104104139.601031-1-chi.minghao@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/mt6380-regulator.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/regulator/mt6380-regulator.c b/drivers/regulator/mt6380-regulator.c index 9efd8710a6f3..2e6b61d3b0cf 100644 --- a/drivers/regulator/mt6380-regulator.c +++ b/drivers/regulator/mt6380-regulator.c @@ -183,7 +183,7 @@ static const unsigned int ldo_volt_table4[] = { static int mt6380_regulator_set_mode(struct regulator_dev *rdev, unsigned int mode) { - int ret, val = 0; + int val = 0; struct mt6380_regulator_info *info = rdev_get_drvdata(rdev); switch (mode) { @@ -199,10 +199,8 @@ static int mt6380_regulator_set_mode(struct regulator_dev *rdev, val <<= ffs(info->modeset_mask) - 1; - ret = regmap_update_bits(rdev->regmap, info->modeset_reg, + return regmap_update_bits(rdev->regmap, info->modeset_reg, info->modeset_mask, val); - - return ret; } static unsigned int mt6380_regulator_get_mode(struct regulator_dev *rdev) |