Skip to content

Commit

Permalink
iio: dac: ad3552r: fix signedness bug in ad3552r_reset()
Browse files Browse the repository at this point in the history
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: 8f2b548 ("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>
  • Loading branch information
Dan Carpenter authored and jic23 committed Apr 4, 2022
1 parent 3123109 commit 460bfa6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/dac/ad3552r.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 460bfa6

Please sign in to comment.