Commit 460bfa65 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jonathan Cameron

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: 8f2b5482 ("drivers:iio:dac: Add AD3552R driver support")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20220316122354.GA16825@kiliSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 31231092
......@@ -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);
......
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