Commit c57dbcab authored by Minghao Chi's avatar Minghao Chi Committed by Mark Brown

drivers/regulator: remove redundant ret variable

Return value from twlreg_write() directly instead
of taking this in another redundant variable.
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarMinghao Chi <chi.minghao@zte.com.cn>
Link: https://lore.kernel.org/r/20211213021655.435423-1-chi.minghao@zte.com.cnSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8d9f738f
...@@ -196,7 +196,6 @@ static int twl4030reg_enable(struct regulator_dev *rdev) ...@@ -196,7 +196,6 @@ static int twl4030reg_enable(struct regulator_dev *rdev)
{ {
struct twlreg_info *info = rdev_get_drvdata(rdev); struct twlreg_info *info = rdev_get_drvdata(rdev);
int grp; int grp;
int ret;
grp = twlreg_grp(rdev); grp = twlreg_grp(rdev);
if (grp < 0) if (grp < 0)
...@@ -204,16 +203,13 @@ static int twl4030reg_enable(struct regulator_dev *rdev) ...@@ -204,16 +203,13 @@ static int twl4030reg_enable(struct regulator_dev *rdev)
grp |= P1_GRP_4030; grp |= P1_GRP_4030;
ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_GRP, grp); return twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_GRP, grp);
return ret;
} }
static int twl4030reg_disable(struct regulator_dev *rdev) static int twl4030reg_disable(struct regulator_dev *rdev)
{ {
struct twlreg_info *info = rdev_get_drvdata(rdev); struct twlreg_info *info = rdev_get_drvdata(rdev);
int grp; int grp;
int ret;
grp = twlreg_grp(rdev); grp = twlreg_grp(rdev);
if (grp < 0) if (grp < 0)
...@@ -221,9 +217,7 @@ static int twl4030reg_disable(struct regulator_dev *rdev) ...@@ -221,9 +217,7 @@ static int twl4030reg_disable(struct regulator_dev *rdev)
grp &= ~(P1_GRP_4030 | P2_GRP_4030 | P3_GRP_4030); grp &= ~(P1_GRP_4030 | P2_GRP_4030 | P3_GRP_4030);
ret = twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_GRP, grp); return twlreg_write(info, TWL_MODULE_PM_RECEIVER, VREG_GRP, grp);
return ret;
} }
static int twl4030reg_get_status(struct regulator_dev *rdev) static int twl4030reg_get_status(struct regulator_dev *rdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment