mbox series

[v2,0/2] iio: dac: ad5770r: dt bindings fixes

Message ID 20200416115848.56156-1-alexandru.tachici@analog.com
Headers show
Series iio: dac: ad5770r: dt bindings fixes | expand

Message

Alexandru Tachici April 16, 2020, 11:58 a.m. UTC
From: Alexandru Tachici <alexandru.tachici@analog.com>

This aims to replace use of num property from dt nodes with
reg property both in dt bindings and driver and fix
dt bindings errors.

1. read from fwnode reg property instead of num property

2. replace num property with reg property and fix dt
bindings errors

Changelog v1 -> v2:
	- replaced "oneOf:" with items for adi,range-microamp
	- added reg allowed values to each channel

Alexandru Tachici (2):
  iio: dac: ad5770r: read channel nr from reg
  dt-bindings: iio: dac: AD5570R fix bindings errors

 .../bindings/iio/dac/adi,ad5770r.yaml         | 82 +++++++++----------
 drivers/iio/dac/ad5770r.c                     |  2 +-
 2 files changed, 40 insertions(+), 44 deletions(-)

Comments

Jonathan Cameron April 18, 2020, 3:30 p.m. UTC | #1
On Thu, 16 Apr 2020 14:58:47 +0300
<alexandru.tachici@analog.com> wrote:

> From: Alexandru Tachici <alexandru.tachici@analog.com>
> 
> Read channel number from the reg property of each child
> node.
> 
> Fixes: cbbb819837f6 ("iio: dac: ad5770r: Add AD5770R support")
> Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
This one is awkwardly timed - I'll be doing a fixes pull request shortly
then advance my fixes branch to include the patch this fixes.

Please poke me if I look like I've forgotten it!
Now we are out of sync with the bindings but as long as we get the fix
in before the release that shouldn't really matter to anyone.

Thanks,

Jonathan

> ---
>  drivers/iio/dac/ad5770r.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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)