Skip to content

Commit 48aa473

Browse files
ye xingchenbroonie
authored andcommitted
regulator: max597x: Remove the unneeded result variable
Return the value from regmap_write() directly instead of storing it in another redundant variable. Reported-by: Zeal Robot <[email protected]> Signed-off-by: ye xingchen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent d927029 commit 48aa473

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/regulator/max597x-regulator.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static int max597x_set_ovp(struct regulator_dev *rdev, int lim_uV, int severity,
137137
static int max597x_set_ocp(struct regulator_dev *rdev, int lim_uA,
138138
int severity, bool enable)
139139
{
140-
int ret, val, reg;
140+
int val, reg;
141141
unsigned int vthst, vthfst;
142142

143143
struct max597x_regulator *data = rdev_get_drvdata(rdev);
@@ -183,9 +183,8 @@ static int max597x_set_ocp(struct regulator_dev *rdev, int lim_uA,
183183
val = 0xFF;
184184

185185
reg = MAX5970_REG_DAC_FAST(rdev_id);
186-
ret = regmap_write(rdev->regmap, reg, val);
187186

188-
return ret;
187+
return regmap_write(rdev->regmap, reg, val);
189188
}
190189

191190
static int max597x_get_status(struct regulator_dev *rdev)

0 commit comments

Comments
 (0)