diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-03-16 15:23:54 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-04-04 09:19:01 +0100 |
commit | 460bfa65b0de72f4d8a808bc7cfb1cb591a95b18 (patch) | |
tree | 5831fc0211916e1aaef0eddbcd67723c3281f435 | |
parent | 3123109284176b1532874591f7c81f3837bbdc17 (diff) | |
download | linux-stable-460bfa65b0de72f4d8a808bc7cfb1cb591a95b18.tar.gz linux-stable-460bfa65b0de72f4d8a808bc7cfb1cb591a95b18.tar.bz2 linux-stable-460bfa65b0de72f4d8a808bc7cfb1cb591a95b18.zip |
iio: dac: ad3552r: fix signedness bug in ad3552r_reset()
The "val" variable is used to store either negative error codes from
ad3552r_read_reg_wrapper() or positive u16 values on success. It needs
to be signed for the error handling to work correctly.
Fixes: 8f2b54824b28 ("drivers:iio:dac: Add AD3552R driver support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220316122354.GA16825@kili
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r-- | drivers/iio/dac/ad3552r.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/dac/ad3552r.c b/drivers/iio/dac/ad3552r.c index 97f13c0b9631..e0a93b27e0e8 100644 --- a/drivers/iio/dac/ad3552r.c +++ b/drivers/iio/dac/ad3552r.c @@ -656,7 +656,7 @@ static int ad3552r_reset(struct ad3552r_desc *dac) { struct reg_addr_pool addr; int ret; - u16 val; + int val; dac->gpio_reset = devm_gpiod_get_optional(&dac->spi->dev, "reset", GPIOD_OUT_LOW); |