Skip to content

Commit 1f156b4

Browse files
Minghao Chibroonie
authored andcommitted
regulator: remove redundant ret variable
Return value from regmap_update_bits() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot <[email protected]> Signed-off-by: Minghao Chi <[email protected]> Signed-off-by: CGEL ZTE <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d27bb69 commit 1f156b4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/regulator/mt6380-regulator.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ static const unsigned int ldo_volt_table4[] = {
183183
static int mt6380_regulator_set_mode(struct regulator_dev *rdev,
184184
unsigned int mode)
185185
{
186-
int ret, val = 0;
186+
int val = 0;
187187
struct mt6380_regulator_info *info = rdev_get_drvdata(rdev);
188188

189189
switch (mode) {
@@ -199,10 +199,8 @@ static int mt6380_regulator_set_mode(struct regulator_dev *rdev,
199199

200200
val <<= ffs(info->modeset_mask) - 1;
201201

202-
ret = regmap_update_bits(rdev->regmap, info->modeset_reg,
202+
return regmap_update_bits(rdev->regmap, info->modeset_reg,
203203
info->modeset_mask, val);
204-
205-
return ret;
206204
}
207205

208206
static unsigned int mt6380_regulator_get_mode(struct regulator_dev *rdev)

0 commit comments

Comments
 (0)