Commit 2ea8db72 authored by Colin Ian King's avatar Colin Ian King Committed by Mark Brown

regulator: tps80031: remove redundant assignment to variables ret and val

The variables ret and val are being initialized with values that are
never read and are being updated later with a new value.  The
initializations are redundant and can be removed.
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Unused value")
Link: https://lore.kernel.org/r/20200410133406.24458-1-colin.king@canonical.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 29ebe87c
...@@ -271,7 +271,7 @@ static int tps80031_vbus_is_enabled(struct regulator_dev *rdev) ...@@ -271,7 +271,7 @@ static int tps80031_vbus_is_enabled(struct regulator_dev *rdev)
{ {
struct tps80031_regulator *ri = rdev_get_drvdata(rdev); struct tps80031_regulator *ri = rdev_get_drvdata(rdev);
struct device *parent = to_tps80031_dev(rdev); struct device *parent = to_tps80031_dev(rdev);
int ret = -EIO; int ret;
uint8_t ctrl1 = 0; uint8_t ctrl1 = 0;
uint8_t ctrl3 = 0; uint8_t ctrl3 = 0;
...@@ -322,7 +322,7 @@ static int tps80031_vbus_disable(struct regulator_dev *rdev) ...@@ -322,7 +322,7 @@ static int tps80031_vbus_disable(struct regulator_dev *rdev)
{ {
struct tps80031_regulator *ri = rdev_get_drvdata(rdev); struct tps80031_regulator *ri = rdev_get_drvdata(rdev);
struct device *parent = to_tps80031_dev(rdev); struct device *parent = to_tps80031_dev(rdev);
int ret = 0; int ret;
if (ri->config_flags & TPS80031_VBUS_DISCHRG_EN_PDN) { if (ri->config_flags & TPS80031_VBUS_DISCHRG_EN_PDN) {
ret = tps80031_write(parent, TPS80031_SLAVE_ID2, ret = tps80031_write(parent, TPS80031_SLAVE_ID2,
...@@ -530,7 +530,8 @@ static int tps80031_regulator_config(struct device *parent, ...@@ -530,7 +530,8 @@ static int tps80031_regulator_config(struct device *parent,
case TPS80031_REGULATOR_LDOUSB: case TPS80031_REGULATOR_LDOUSB:
if (ri->config_flags & (TPS80031_USBLDO_INPUT_VSYS | if (ri->config_flags & (TPS80031_USBLDO_INPUT_VSYS |
TPS80031_USBLDO_INPUT_PMID)) { TPS80031_USBLDO_INPUT_PMID)) {
unsigned val = 0; unsigned val;
if (ri->config_flags & TPS80031_USBLDO_INPUT_VSYS) if (ri->config_flags & TPS80031_USBLDO_INPUT_VSYS)
val = MISC2_LDOUSB_IN_VSYS; val = MISC2_LDOUSB_IN_VSYS;
else else
......
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