diff mbox series

[v5,4/6] drivers: iio: dac: ad5766: Fix dt property name

Message ID 20210916182914.1810-5-mihail.chindris@analog.com (mailing list archive)
State Changes Requested
Headers show
Series iio: Add output buffer support | expand

Commit Message

Chindris, Mihail Sept. 16, 2021, 6:29 p.m. UTC
In the documentation the name for the property is
output-range-microvolts which is a standard name, therefore this name
must be used.

Signed-off-by: Mihail Chindris <mihail.chindris@analog.com>
---
 drivers/iio/dac/ad5766.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Alexandru Ardelean Sept. 17, 2021, 7:53 a.m. UTC | #1
On Fri, Sep 17, 2021 at 9:11 AM Mihail Chindris
<mihail.chindris@analog.com> wrote:
>
> In the documentation the name for the property is
> output-range-microvolts which is a standard name, therefore this name
> must be used.
>

This requires a Fixes tag.
With that addressed:

Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>

> Signed-off-by: Mihail Chindris <mihail.chindris@analog.com>
> ---
>  drivers/iio/dac/ad5766.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/dac/ad5766.c b/drivers/iio/dac/ad5766.c
> index 3104ec32dfac..dafda84fdea3 100644
> --- a/drivers/iio/dac/ad5766.c
> +++ b/drivers/iio/dac/ad5766.c
> @@ -503,13 +503,13 @@ static int ad5766_get_output_range(struct ad5766_state *st)
>         int i, ret, min, max, tmp[2];
>
>         ret = device_property_read_u32_array(&st->spi->dev,
> -                                            "output-range-voltage",
> +                                            "output-range-microvolts",
>                                              tmp, 2);
>         if (ret)
>                 return ret;
>
> -       min = tmp[0] / 1000;
> -       max = tmp[1] / 1000;
> +       min = tmp[0] / 1000000;
> +       max = tmp[1] / 1000000;
>         for (i = 0; i < ARRAY_SIZE(ad5766_span_tbl); i++) {
>                 if (ad5766_span_tbl[i].min != min ||
>                     ad5766_span_tbl[i].max != max)
> --
> 2.27.0
>
Jonathan Cameron Sept. 19, 2021, 5:11 p.m. UTC | #2
On Fri, 17 Sep 2021 10:53:54 +0300
Alexandru Ardelean <ardeleanalex@gmail.com> wrote:

> On Fri, Sep 17, 2021 at 9:11 AM Mihail Chindris
> <mihail.chindris@analog.com> wrote:
> >
> > In the documentation the name for the property is
> > output-range-microvolts which is a standard name, therefore this name
> > must be used.
> >  
> 
> This requires a Fixes tag.
> With that addressed:
> 
> Reviewed-by: Alexandru Ardelean <ardeleanalex@gmail.com>

Good catch. These cases are always a mess. 
As the binding doc went in with the driver, there should have been no window
in which anyone who was actually checking their DTS files against the yaml could
have this wrong. Hopefully that means we don't have any broken ones out there in the wild

As this is binding related, sensible to cc Rob and the dt list.
+CC


> 
> > Signed-off-by: Mihail Chindris <mihail.chindris@analog.com>
> > ---
> >  drivers/iio/dac/ad5766.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/iio/dac/ad5766.c b/drivers/iio/dac/ad5766.c
> > index 3104ec32dfac..dafda84fdea3 100644
> > --- a/drivers/iio/dac/ad5766.c
> > +++ b/drivers/iio/dac/ad5766.c
> > @@ -503,13 +503,13 @@ static int ad5766_get_output_range(struct ad5766_state *st)
> >         int i, ret, min, max, tmp[2];
> >
> >         ret = device_property_read_u32_array(&st->spi->dev,
> > -                                            "output-range-voltage",
> > +                                            "output-range-microvolts",
> >                                              tmp, 2);
> >         if (ret)
> >                 return ret;
> >
> > -       min = tmp[0] / 1000;
> > -       max = tmp[1] / 1000;
> > +       min = tmp[0] / 1000000;
> > +       max = tmp[1] / 1000000;
> >         for (i = 0; i < ARRAY_SIZE(ad5766_span_tbl); i++) {
> >                 if (ad5766_span_tbl[i].min != min ||
> >                     ad5766_span_tbl[i].max != max)
> > --
> > 2.27.0
> >
diff mbox series

Patch

diff --git a/drivers/iio/dac/ad5766.c b/drivers/iio/dac/ad5766.c
index 3104ec32dfac..dafda84fdea3 100644
--- a/drivers/iio/dac/ad5766.c
+++ b/drivers/iio/dac/ad5766.c
@@ -503,13 +503,13 @@  static int ad5766_get_output_range(struct ad5766_state *st)
 	int i, ret, min, max, tmp[2];
 
 	ret = device_property_read_u32_array(&st->spi->dev,
-					     "output-range-voltage",
+					     "output-range-microvolts",
 					     tmp, 2);
 	if (ret)
 		return ret;
 
-	min = tmp[0] / 1000;
-	max = tmp[1] / 1000;
+	min = tmp[0] / 1000000;
+	max = tmp[1] / 1000000;
 	for (i = 0; i < ARRAY_SIZE(ad5766_span_tbl); i++) {
 		if (ad5766_span_tbl[i].min != min ||
 		    ad5766_span_tbl[i].max != max)