mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
iio: light: si1133: fix uninitialized resp variable
Read response register to detect any error. Signed-off-by: Maxime Roussin-Bélanger <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
This commit is contained in:
parent
2b4ec22d36
commit
496fb59e12
1 changed files with 3 additions and 0 deletions
|
|
@ -409,6 +409,9 @@ static int si1133_command(struct si1133_data *data, u8 cmd)
|
|||
err = -ETIMEDOUT;
|
||||
goto out;
|
||||
}
|
||||
err = regmap_read(data->regmap, SI1133_REG_RESPONSE0, &resp);
|
||||
if (err)
|
||||
goto out;
|
||||
} else {
|
||||
err = regmap_read_poll_timeout(data->regmap,
|
||||
SI1133_REG_RESPONSE0, resp,
|
||||
|
|
|
|||
Loading…
Reference in a new issue