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 <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/20220824074707.221159-1-ye.xingchen@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
ye xingchen 2022-08-24 07:47:07 +00:00 committed by Mark Brown
parent d9270292e6
commit 48aa47308d
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 2 additions and 3 deletions

View File

@ -137,7 +137,7 @@ static int max597x_set_ovp(struct regulator_dev *rdev, int lim_uV, int severity,
static int max597x_set_ocp(struct regulator_dev *rdev, int lim_uA,
int severity, bool enable)
{
int ret, val, reg;
int val, reg;
unsigned int vthst, vthfst;
struct max597x_regulator *data = rdev_get_drvdata(rdev);
@ -183,9 +183,8 @@ static int max597x_set_ocp(struct regulator_dev *rdev, int lim_uA,
val = 0xFF;
reg = MAX5970_REG_DAC_FAST(rdev_id);
ret = regmap_write(rdev->regmap, reg, val);
return ret;
return regmap_write(rdev->regmap, reg, val);
}
static int max597x_get_status(struct regulator_dev *rdev)