Skip to content

Commit 2ea8db7

Browse files
Colin Ian Kingbroonie
authored andcommitted
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: Colin Ian King <[email protected]> Addresses-Coverity: ("Unused value") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 29ebe87 commit 2ea8db7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/regulator/tps80031-regulator.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ static int tps80031_vbus_is_enabled(struct regulator_dev *rdev)
271271
{
272272
struct tps80031_regulator *ri = rdev_get_drvdata(rdev);
273273
struct device *parent = to_tps80031_dev(rdev);
274-
int ret = -EIO;
274+
int ret;
275275
uint8_t ctrl1 = 0;
276276
uint8_t ctrl3 = 0;
277277

@@ -322,7 +322,7 @@ static int tps80031_vbus_disable(struct regulator_dev *rdev)
322322
{
323323
struct tps80031_regulator *ri = rdev_get_drvdata(rdev);
324324
struct device *parent = to_tps80031_dev(rdev);
325-
int ret = 0;
325+
int ret;
326326

327327
if (ri->config_flags & TPS80031_VBUS_DISCHRG_EN_PDN) {
328328
ret = tps80031_write(parent, TPS80031_SLAVE_ID2,
@@ -530,7 +530,8 @@ static int tps80031_regulator_config(struct device *parent,
530530
case TPS80031_REGULATOR_LDOUSB:
531531
if (ri->config_flags & (TPS80031_USBLDO_INPUT_VSYS |
532532
TPS80031_USBLDO_INPUT_PMID)) {
533-
unsigned val = 0;
533+
unsigned val;
534+
534535
if (ri->config_flags & TPS80031_USBLDO_INPUT_VSYS)
535536
val = MISC2_LDOUSB_IN_VSYS;
536537
else

0 commit comments

Comments
 (0)