diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-04-14 05:34:07 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-04-14 09:46:19 -0400 |
commit | 7cb7348f75e442e2ea4bc0b2430a232b13998abf (patch) | |
tree | 74e7a6fd246993cd61a8c79ea393c94eef51a79d /drivers/regulator/lp3972.c | |
parent | f55532a0c0b8bb6148f4e07853b876ef73bc69ca (diff) |
regulator: lp3972: Silence uninitialized variable warning
This is harmless but my static checker complains that "tmp" is
uninitialized if lp3972_i2c_read() fails. I have moved the line of code
below the error handling to silence the warning.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/lp3972.c')
-rw-r--r-- | drivers/regulator/lp3972.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/lp3972.c b/drivers/regulator/lp3972.c index 3a7e96e2c7b3..ff0c275f902e 100644 --- a/drivers/regulator/lp3972.c +++ b/drivers/regulator/lp3972.c | |||
@@ -211,8 +211,8 @@ static int lp3972_set_bits(struct lp3972 *lp3972, u8 reg, u16 mask, u16 val) | |||
211 | mutex_lock(&lp3972->io_lock); | 211 | mutex_lock(&lp3972->io_lock); |
212 | 212 | ||
213 | ret = lp3972_i2c_read(lp3972->i2c, reg, 1, &tmp); | 213 | ret = lp3972_i2c_read(lp3972->i2c, reg, 1, &tmp); |
214 | tmp = (tmp & ~mask) | val; | ||
215 | if (ret == 0) { | 214 | if (ret == 0) { |
215 | tmp = (tmp & ~mask) | val; | ||
216 | ret = lp3972_i2c_write(lp3972->i2c, reg, 1, &tmp); | 216 | ret = lp3972_i2c_write(lp3972->i2c, reg, 1, &tmp); |
217 | dev_dbg(lp3972->dev, "reg write 0x%02x -> 0x%02x\n", (int)reg, | 217 | dev_dbg(lp3972->dev, "reg write 0x%02x -> 0x%02x\n", (int)reg, |
218 | (unsigned)val & 0xff); | 218 | (unsigned)val & 0xff); |