[RESEND,1/2] iio: dac: ad5770r: read channel nr from reg
diff mbox series

Message ID 20200324094506.55938-2-alexandru.tachici@analog.com
State New
Headers show
  • iio: dac: ad5770r: dt bindings fixes
Related show

Commit Message

Alexandru Tachici March 24, 2020, 9:45 a.m. UTC
From: Alexandru Tachici <alexandru.tachici@analog.com>

Read channel number from the reg property of each child

Fixes: cbbb819837f6 ("iio: dac: ad5770r: Add AD5770R support")
Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
 drivers/iio/dac/ad5770r.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox series

diff --git a/drivers/iio/dac/ad5770r.c b/drivers/iio/dac/ad5770r.c
index a98ea76732e7..6302f11551d4 100644
--- a/drivers/iio/dac/ad5770r.c
+++ b/drivers/iio/dac/ad5770r.c
@@ -522,7 +522,7 @@  static int ad5770r_channel_config(struct ad5770r_state *st)
 		return -EINVAL;
 	device_for_each_child_node(&st->spi->dev, child) {
-		ret = fwnode_property_read_u32(child, "num", &num);
+		ret = fwnode_property_read_u32(child, "reg", &num);
 		if (ret)
 			return ret;
 		if (num > AD5770R_MAX_CHANNELS)