iio: dac: ad5592r: Fix the missing return value.
authorZizhuang Deng <sunsetdzz@gmail.com>
Thu, 10 Mar 2022 12:54:50 +0000 (20:54 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 4 Apr 2022 08:19:01 +0000 (09:19 +0100)
The third call to `fwnode_property_read_u32` did not record
the return value, resulting in `channel_offstate` possibly
being assigned the wrong value.

Fixes: 56ca9db862bf ("iio: dac: Add support for the AD5592R/AD5593R ADCs/DACs")
Signed-off-by: Zizhuang Deng <sunsetdzz@gmail.com>
Link: https://lore.kernel.org/r/20220310125450.4164164-1-sunsetdzz@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/dac/ad5592r-base.c

index a424b72..4434c1b 100644 (file)
@@ -522,7 +522,7 @@ static int ad5592r_alloc_channels(struct iio_dev *iio_dev)
                if (!ret)
                        st->channel_modes[reg] = tmp;
 
-               fwnode_property_read_u32(child, "adi,off-state", &tmp);
+               ret = fwnode_property_read_u32(child, "adi,off-state", &tmp);
                if (!ret)
                        st->channel_offstate[reg] = tmp;
        }