linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] iio:potentiostat:lmp91000: Adjust codestyle, and minor cleanup changes
@ 2019-03-08 19:46 Anderson Reis
  2019-03-08 19:46 ` [PATCH v2 1/4] iio:potentiostat:lmp91000: remove unnecessary parentheses Anderson Reis
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Anderson Reis @ 2019-03-08 19:46 UTC (permalink / raw)
  To: jic23, knaack.h, lars, pmeerw, matt.ranostay
  Cc: linux-iio, linux-kernel, kernel-usp, Anderson Reis

Hi,

We solved some checkpath.el CHECKs and WARNINGs. We also inverted the arms of
an if statement, in order to make the code smaller as the else statement was
supressed. We also changed a dev_err message as requested


Anderson Reis (3):
  iio:potentiostat:lmp91000: reduce line width and remove blank line
  iio:potentiostat:lmp91000: invert if statement
  iio:potentiostat:lmp91000: change dev_err message

Lucas Oshiro (1):
  iio:potentiostat:lmp91000: remove unnecessary parentheses

 drivers/iio/potentiostat/lmp91000.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH v2 1/4] iio:potentiostat:lmp91000: remove unnecessary parentheses
  2019-03-08 19:46 [PATCH v2 0/4] iio:potentiostat:lmp91000: Adjust codestyle, and minor cleanup changes Anderson Reis
@ 2019-03-08 19:46 ` Anderson Reis
  2019-03-08 21:04   ` Tomasz Duszynski
  2019-03-08 19:46 ` [PATCH v2 2/4] iio:potentiostat:lmp91000: reduce line width and remove blank line Anderson Reis
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Anderson Reis @ 2019-03-08 19:46 UTC (permalink / raw)
  To: jic23, knaack.h, lars, pmeerw, matt.ranostay
  Cc: linux-iio, linux-kernel, kernel-usp, Lucas Oshiro, Anderson Reis

From: Lucas Oshiro <lucasseikioshiro@gmail.com>

Remove unnecessary parentheses on line 116, and solve these checkpatch.pl
CHECKs:

- lmp91000.c:116: CHECK: Unnecessary parentheses around 'state != channel'
- lmp91000.c:116: CHECK: Unnecessary parentheses around 'channel == LMP91000_REG_MODECN_TEMP'

Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Anderson Reis <andersonreisrosa@gmail.com>
---
 drivers/iio/potentiostat/lmp91000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
index 90e895adf997..03d277621861 100644
--- a/drivers/iio/potentiostat/lmp91000.c
+++ b/drivers/iio/potentiostat/lmp91000.c
@@ -113,7 +113,7 @@ static int lmp91000_read(struct lmp91000_data *data, int channel, int *val)
 		return -EINVAL;
 
 	/* delay till first temperature reading is complete */
-	if ((state != channel) && (channel == LMP91000_REG_MODECN_TEMP))
+	if (state != channel && channel == LMP91000_REG_MODECN_TEMP)
 		usleep_range(3000, 4000);
 
 	data->chan_select = channel != LMP91000_REG_MODECN_3LEAD;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 2/4] iio:potentiostat:lmp91000: reduce line width and remove blank line
  2019-03-08 19:46 [PATCH v2 0/4] iio:potentiostat:lmp91000: Adjust codestyle, and minor cleanup changes Anderson Reis
  2019-03-08 19:46 ` [PATCH v2 1/4] iio:potentiostat:lmp91000: remove unnecessary parentheses Anderson Reis
@ 2019-03-08 19:46 ` Anderson Reis
  2019-03-09 18:45   ` Jonathan Cameron
  2019-03-08 19:46 ` [PATCH v2 3/4] iio:potentiostat:lmp91000: invert if statement Anderson Reis
  2019-03-08 19:46 ` [PATCH v2 4/4] iio:potentiostat:lmp91000: change dev_err message Anderson Reis
  3 siblings, 1 reply; 11+ messages in thread
From: Anderson Reis @ 2019-03-08 19:46 UTC (permalink / raw)
  To: jic23, knaack.h, lars, pmeerw, matt.ranostay
  Cc: linux-iio, linux-kernel, kernel-usp, Anderson Reis, Lucas Oshiro,
	Anderson Reis

Break the line 258 in order fit the line width on 80 characters. Remove
the blank line 279, as the line before is also a blank line. Solve these
checkpath.el WARNING and CHECK:

- lmp91000.c:258: WARNING: line over 80 characters
- lmp91000.c:279: CHECK: Please don't use multiple blank lines

Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Anderson Reis <andersonreisrosa@gmail.com>
---
 drivers/iio/potentiostat/lmp91000.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
index 03d277621861..c45cfb632649 100644
--- a/drivers/iio/potentiostat/lmp91000.c
+++ b/drivers/iio/potentiostat/lmp91000.c
@@ -255,8 +255,8 @@ static int lmp91000_read_config(struct lmp91000_data *data)
 
 	regmap_write(data->regmap, LMP91000_REG_LOCK, 0);
 	regmap_write(data->regmap, LMP91000_REG_TIACN, reg);
-	regmap_write(data->regmap, LMP91000_REG_REFCN, LMP91000_REG_REFCN_EXT_REF
-					| LMP91000_REG_REFCN_50_ZERO);
+	regmap_write(data->regmap, LMP91000_REG_REFCN,
+		     LMP91000_REG_REFCN_EXT_REF | LMP91000_REG_REFCN_50_ZERO);
 	regmap_write(data->regmap, LMP91000_REG_LOCK, 1);
 
 	return 0;
@@ -276,7 +276,6 @@ static int lmp91000_buffer_cb(const void *val, void *private)
 static const struct iio_trigger_ops lmp91000_trigger_ops = {
 };
 
-
 static int lmp91000_buffer_preenable(struct iio_dev *indio_dev)
 {
 	struct lmp91000_data *data = iio_priv(indio_dev);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 3/4] iio:potentiostat:lmp91000: invert if statement
  2019-03-08 19:46 [PATCH v2 0/4] iio:potentiostat:lmp91000: Adjust codestyle, and minor cleanup changes Anderson Reis
  2019-03-08 19:46 ` [PATCH v2 1/4] iio:potentiostat:lmp91000: remove unnecessary parentheses Anderson Reis
  2019-03-08 19:46 ` [PATCH v2 2/4] iio:potentiostat:lmp91000: reduce line width and remove blank line Anderson Reis
@ 2019-03-08 19:46 ` Anderson Reis
  2019-03-09 18:46   ` Jonathan Cameron
  2019-03-08 19:46 ` [PATCH v2 4/4] iio:potentiostat:lmp91000: change dev_err message Anderson Reis
  3 siblings, 1 reply; 11+ messages in thread
From: Anderson Reis @ 2019-03-08 19:46 UTC (permalink / raw)
  To: jic23, knaack.h, lars, pmeerw, matt.ranostay
  Cc: linux-iio, linux-kernel, kernel-usp, Anderson Reis, Lucas Oshiro,
	Anderson Reis

Invert if statement arms in line 214, in order to make the code cleaner,
solve these checkpatch.pl CHECKs:

- lmp9100.c:214: CHECK: braces {} should be used on all arms of this statement
- lmp9100.c:216: CHECK: Unbalanced braces around else statement

Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: Anderson Reis <andersonreisrosa@gmail.com>
---
 drivers/iio/potentiostat/lmp91000.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
index c45cfb632649..1de17924e154 100644
--- a/drivers/iio/potentiostat/lmp91000.c
+++ b/drivers/iio/potentiostat/lmp91000.c
@@ -211,12 +211,11 @@ static int lmp91000_read_config(struct lmp91000_data *data)
 
 	ret = of_property_read_u32(np, "ti,tia-gain-ohm", &val);
 	if (ret) {
-		if (of_property_read_bool(np, "ti,external-tia-resistor"))
-			val = 0;
-		else {
+		if (!of_property_read_bool(np, "ti,external-tia-resistor"))
 			dev_err(dev, "no ti,tia-gain-ohm defined");
 			return ret;
 		}
+		val = 0;
 	}
 
 	ret = -EINVAL;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 4/4] iio:potentiostat:lmp91000: change dev_err message
  2019-03-08 19:46 [PATCH v2 0/4] iio:potentiostat:lmp91000: Adjust codestyle, and minor cleanup changes Anderson Reis
                   ` (2 preceding siblings ...)
  2019-03-08 19:46 ` [PATCH v2 3/4] iio:potentiostat:lmp91000: invert if statement Anderson Reis
@ 2019-03-08 19:46 ` Anderson Reis
  2019-03-09 18:49   ` Jonathan Cameron
  3 siblings, 1 reply; 11+ messages in thread
From: Anderson Reis @ 2019-03-08 19:46 UTC (permalink / raw)
  To: jic23, knaack.h, lars, pmeerw, matt.ranostay
  Cc: linux-iio, linux-kernel, kernel-usp, Anderson Reis,
	Anderson Reis, Lucas Oshiro

Change dev_err message on line 215 in order to inform that
tia-gain-ohm is not defined and an external resistor is not
specified.

Signed-off-by: Anderson Reis <andersonreisrosa@gmail.com>
Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
---
 drivers/iio/potentiostat/lmp91000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
index 1de17924e154..5ed9752008a5 100644
--- a/drivers/iio/potentiostat/lmp91000.c
+++ b/drivers/iio/potentiostat/lmp91000.c
@@ -212,7 +212,7 @@ static int lmp91000_read_config(struct lmp91000_data *data)
 	ret = of_property_read_u32(np, "ti,tia-gain-ohm", &val);
 	if (ret) {
 		if (!of_property_read_bool(np, "ti,external-tia-resistor"))
-			dev_err(dev, "no ti,tia-gain-ohm defined");
+			dev_err(dev, "no ti,tia-gain-ohm defined and external resistor not specified\n");
 			return ret;
 		}
 		val = 0;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/4] iio:potentiostat:lmp91000: remove unnecessary parentheses
  2019-03-08 19:46 ` [PATCH v2 1/4] iio:potentiostat:lmp91000: remove unnecessary parentheses Anderson Reis
@ 2019-03-08 21:04   ` Tomasz Duszynski
       [not found]     ` <CAJut9009qPt50o4CDNpkZ=NQVetivYHJMi2pY_DrDUk=WN=XMw@mail.gmail.com>
  0 siblings, 1 reply; 11+ messages in thread
From: Tomasz Duszynski @ 2019-03-08 21:04 UTC (permalink / raw)
  To: Anderson Reis
  Cc: jic23, knaack.h, lars, pmeerw, matt.ranostay, linux-iio,
	linux-kernel, kernel-usp, Lucas Oshiro

On Fri, Mar 08, 2019 at 04:46:52PM -0300, Anderson Reis wrote:
> From: Lucas Oshiro <lucasseikioshiro@gmail.com>
>
> Remove unnecessary parentheses on line 116, and solve these checkpatch.pl

No need to explicitly point finger at changed lines. This is what
context lines are for.

> CHECKs:
>
> - lmp91000.c:116: CHECK: Unnecessary parentheses around 'state != channel'
> - lmp91000.c:116: CHECK: Unnecessary parentheses around 'channel == LMP91000_REG_MODECN_TEMP'
>
> Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
> Signed-off-by: Anderson Reis <andersonreisrosa@gmail.com>
> ---
>  drivers/iio/potentiostat/lmp91000.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
> index 90e895adf997..03d277621861 100644
> --- a/drivers/iio/potentiostat/lmp91000.c
> +++ b/drivers/iio/potentiostat/lmp91000.c
> @@ -113,7 +113,7 @@ static int lmp91000_read(struct lmp91000_data *data, int channel, int *val)
>  		return -EINVAL;
>
>  	/* delay till first temperature reading is complete */
> -	if ((state != channel) && (channel == LMP91000_REG_MODECN_TEMP))
> +	if (state != channel && channel == LMP91000_REG_MODECN_TEMP)
>  		usleep_range(3000, 4000);
>
>  	data->chan_select = channel != LMP91000_REG_MODECN_3LEAD;
> --
> 2.20.1
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/4] iio:potentiostat:lmp91000: remove unnecessary parentheses
       [not found]     ` <CAJut9009qPt50o4CDNpkZ=NQVetivYHJMi2pY_DrDUk=WN=XMw@mail.gmail.com>
@ 2019-03-09 18:44       ` Jonathan Cameron
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2019-03-09 18:44 UTC (permalink / raw)
  To: Anderson Reis
  Cc: Tomasz Duszynski, knaack.h, lars, pmeerw, matt.ranostay,
	linux-iio, linux-kernel, kernel-usp, Lucas Oshiro

On Fri, 8 Mar 2019 19:26:16 -0300
Anderson Reis <andersonreisrosa@gmail.com> wrote:

> Hi, Tomasz
> 
> thanks for the guidance.
Applied with the description tweaked.

Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan

> 
> 
> 
> On Fri, Mar 8, 2019, 18:04 Tomasz Duszynski <tduszyns@gmail.com> wrote:
> 
> > On Fri, Mar 08, 2019 at 04:46:52PM -0300, Anderson Reis wrote:  
> > > From: Lucas Oshiro <lucasseikioshiro@gmail.com>
> > >
> > > Remove unnecessary parentheses on line 116, and solve these  
> > checkpatch.pl
> >
> > No need to explicitly point finger at changed lines. This is what
> > context lines are for.
> >  
> > > CHECKs:
> > >
> > > - lmp91000.c:116: CHECK: Unnecessary parentheses around 'state !=  
> > channel'  
> > > - lmp91000.c:116: CHECK: Unnecessary parentheses around 'channel ==  
> > LMP91000_REG_MODECN_TEMP'  
> > >
> > > Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
> > > Signed-off-by: Anderson Reis <andersonreisrosa@gmail.com>
> > > ---
> > >  drivers/iio/potentiostat/lmp91000.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/iio/potentiostat/lmp91000.c  
> > b/drivers/iio/potentiostat/lmp91000.c  
> > > index 90e895adf997..03d277621861 100644
> > > --- a/drivers/iio/potentiostat/lmp91000.c
> > > +++ b/drivers/iio/potentiostat/lmp91000.c
> > > @@ -113,7 +113,7 @@ static int lmp91000_read(struct lmp91000_data *data,  
> > int channel, int *val)  
> > >               return -EINVAL;
> > >
> > >       /* delay till first temperature reading is complete */
> > > -     if ((state != channel) && (channel == LMP91000_REG_MODECN_TEMP))
> > > +     if (state != channel && channel == LMP91000_REG_MODECN_TEMP)
> > >               usleep_range(3000, 4000);
> > >
> > >       data->chan_select = channel != LMP91000_REG_MODECN_3LEAD;
> > > --
> > > 2.20.1
> > >  
> >  


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/4] iio:potentiostat:lmp91000: reduce line width and remove blank line
  2019-03-08 19:46 ` [PATCH v2 2/4] iio:potentiostat:lmp91000: reduce line width and remove blank line Anderson Reis
@ 2019-03-09 18:45   ` Jonathan Cameron
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2019-03-09 18:45 UTC (permalink / raw)
  To: Anderson Reis
  Cc: knaack.h, lars, pmeerw, matt.ranostay, linux-iio, linux-kernel,
	kernel-usp, Anderson Reis, Lucas Oshiro

On Fri,  8 Mar 2019 16:46:53 -0300
Anderson Reis <andersonreisrosa@gmail.com> wrote:

> Break the line 258 in order fit the line width on 80 characters. Remove
> the blank line 279, as the line before is also a blank line. Solve these
> checkpath.el WARNING and CHECK:
> 
> - lmp91000.c:258: WARNING: line over 80 characters
> - lmp91000.c:279: CHECK: Please don't use multiple blank lines
Again, not really needed, but doesn't matter much

Applied.

Thanks,

Jonathan

> 
> Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
> Signed-off-by: Anderson Reis <andersonreisrosa@gmail.com>
> ---
>  drivers/iio/potentiostat/lmp91000.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
> index 03d277621861..c45cfb632649 100644
> --- a/drivers/iio/potentiostat/lmp91000.c
> +++ b/drivers/iio/potentiostat/lmp91000.c
> @@ -255,8 +255,8 @@ static int lmp91000_read_config(struct lmp91000_data *data)
>  
>  	regmap_write(data->regmap, LMP91000_REG_LOCK, 0);
>  	regmap_write(data->regmap, LMP91000_REG_TIACN, reg);
> -	regmap_write(data->regmap, LMP91000_REG_REFCN, LMP91000_REG_REFCN_EXT_REF
> -					| LMP91000_REG_REFCN_50_ZERO);
> +	regmap_write(data->regmap, LMP91000_REG_REFCN,
> +		     LMP91000_REG_REFCN_EXT_REF | LMP91000_REG_REFCN_50_ZERO);
>  	regmap_write(data->regmap, LMP91000_REG_LOCK, 1);
>  
>  	return 0;
> @@ -276,7 +276,6 @@ static int lmp91000_buffer_cb(const void *val, void *private)
>  static const struct iio_trigger_ops lmp91000_trigger_ops = {
>  };
>  
> -
>  static int lmp91000_buffer_preenable(struct iio_dev *indio_dev)
>  {
>  	struct lmp91000_data *data = iio_priv(indio_dev);


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 3/4] iio:potentiostat:lmp91000: invert if statement
  2019-03-08 19:46 ` [PATCH v2 3/4] iio:potentiostat:lmp91000: invert if statement Anderson Reis
@ 2019-03-09 18:46   ` Jonathan Cameron
  2019-03-09 18:48     ` Jonathan Cameron
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Cameron @ 2019-03-09 18:46 UTC (permalink / raw)
  To: Anderson Reis
  Cc: knaack.h, lars, pmeerw, matt.ranostay, linux-iio, linux-kernel,
	kernel-usp, Anderson Reis, Lucas Oshiro

On Fri,  8 Mar 2019 16:46:54 -0300
Anderson Reis <andersonreisrosa@gmail.com> wrote:

> Invert if statement arms in line 214, in order to make the code cleaner,
> solve these checkpatch.pl CHECKs:
> 
> - lmp9100.c:214: CHECK: braces {} should be used on all arms of this statement
> - lmp9100.c:216: CHECK: Unbalanced braces around else statement
> 
> Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
> Signed-off-by: Anderson Reis <andersonreisrosa@gmail.com>
Applied.

Thanks,

Jonathan

> ---
>  drivers/iio/potentiostat/lmp91000.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
> index c45cfb632649..1de17924e154 100644
> --- a/drivers/iio/potentiostat/lmp91000.c
> +++ b/drivers/iio/potentiostat/lmp91000.c
> @@ -211,12 +211,11 @@ static int lmp91000_read_config(struct lmp91000_data *data)
>  
>  	ret = of_property_read_u32(np, "ti,tia-gain-ohm", &val);
>  	if (ret) {
> -		if (of_property_read_bool(np, "ti,external-tia-resistor"))
> -			val = 0;
> -		else {
> +		if (!of_property_read_bool(np, "ti,external-tia-resistor"))
>  			dev_err(dev, "no ti,tia-gain-ohm defined");
>  			return ret;
>  		}
> +		val = 0;
>  	}
>  
>  	ret = -EINVAL;


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 3/4] iio:potentiostat:lmp91000: invert if statement
  2019-03-09 18:46   ` Jonathan Cameron
@ 2019-03-09 18:48     ` Jonathan Cameron
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2019-03-09 18:48 UTC (permalink / raw)
  To: Anderson Reis
  Cc: knaack.h, lars, pmeerw, matt.ranostay, linux-iio, linux-kernel,
	kernel-usp, Anderson Reis, Lucas Oshiro

On Sat, 9 Mar 2019 18:46:15 +0000
Jonathan Cameron <jic23@kernel.org> wrote:

> On Fri,  8 Mar 2019 16:46:54 -0300
> Anderson Reis <andersonreisrosa@gmail.com> wrote:
> 
> > Invert if statement arms in line 214, in order to make the code cleaner,
> > solve these checkpatch.pl CHECKs:
> > 
> > - lmp9100.c:214: CHECK: braces {} should be used on all arms of this statement
> > - lmp9100.c:216: CHECK: Unbalanced braces around else statement
> > 
> > Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
> > Signed-off-by: Anderson Reis <andersonreisrosa@gmail.com>  
> Applied.
> 
> Thanks,
> 
> Jonathan
> 
> > ---
> >  drivers/iio/potentiostat/lmp91000.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
> > index c45cfb632649..1de17924e154 100644
> > --- a/drivers/iio/potentiostat/lmp91000.c
> > +++ b/drivers/iio/potentiostat/lmp91000.c
> > @@ -211,12 +211,11 @@ static int lmp91000_read_config(struct lmp91000_data *data)
> >  
> >  	ret = of_property_read_u32(np, "ti,tia-gain-ohm", &val);
> >  	if (ret) {
> > -		if (of_property_read_bool(np, "ti,external-tia-resistor"))
> > -			val = 0;
> > -		else {
> > +		if (!of_property_read_bool(np, "ti,external-tia-resistor"))
Spoke too soon. You didn't build test this.  Missing {

Fixed up.

Jonathan

> >  			dev_err(dev, "no ti,tia-gain-ohm defined");
> >  			return ret;
> >  		}
> > +		val = 0;
> >  	}
> >  
> >  	ret = -EINVAL;  
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 4/4] iio:potentiostat:lmp91000: change dev_err message
  2019-03-08 19:46 ` [PATCH v2 4/4] iio:potentiostat:lmp91000: change dev_err message Anderson Reis
@ 2019-03-09 18:49   ` Jonathan Cameron
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Cameron @ 2019-03-09 18:49 UTC (permalink / raw)
  To: Anderson Reis
  Cc: knaack.h, lars, pmeerw, matt.ranostay, linux-iio, linux-kernel,
	kernel-usp, Anderson Reis, Lucas Oshiro

On Fri,  8 Mar 2019 16:46:55 -0300
Anderson Reis <andersonreisrosa@gmail.com> wrote:

> Change dev_err message on line 215 in order to inform that
> tia-gain-ohm is not defined and an external resistor is not
> specified.
> 
> Signed-off-by: Anderson Reis <andersonreisrosa@gmail.com>
> Signed-off-by: Lucas Oshiro <lucasseikioshiro@gmail.com>
Applied.

Thanks,

Jonathan

> ---
>  drivers/iio/potentiostat/lmp91000.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
> index 1de17924e154..5ed9752008a5 100644
> --- a/drivers/iio/potentiostat/lmp91000.c
> +++ b/drivers/iio/potentiostat/lmp91000.c
> @@ -212,7 +212,7 @@ static int lmp91000_read_config(struct lmp91000_data *data)
>  	ret = of_property_read_u32(np, "ti,tia-gain-ohm", &val);
>  	if (ret) {
>  		if (!of_property_read_bool(np, "ti,external-tia-resistor"))
> -			dev_err(dev, "no ti,tia-gain-ohm defined");
> +			dev_err(dev, "no ti,tia-gain-ohm defined and external resistor not specified\n");
>  			return ret;
>  		}
>  		val = 0;


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-03-16 16:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-08 19:46 [PATCH v2 0/4] iio:potentiostat:lmp91000: Adjust codestyle, and minor cleanup changes Anderson Reis
2019-03-08 19:46 ` [PATCH v2 1/4] iio:potentiostat:lmp91000: remove unnecessary parentheses Anderson Reis
2019-03-08 21:04   ` Tomasz Duszynski
     [not found]     ` <CAJut9009qPt50o4CDNpkZ=NQVetivYHJMi2pY_DrDUk=WN=XMw@mail.gmail.com>
2019-03-09 18:44       ` Jonathan Cameron
2019-03-08 19:46 ` [PATCH v2 2/4] iio:potentiostat:lmp91000: reduce line width and remove blank line Anderson Reis
2019-03-09 18:45   ` Jonathan Cameron
2019-03-08 19:46 ` [PATCH v2 3/4] iio:potentiostat:lmp91000: invert if statement Anderson Reis
2019-03-09 18:46   ` Jonathan Cameron
2019-03-09 18:48     ` Jonathan Cameron
2019-03-08 19:46 ` [PATCH v2 4/4] iio:potentiostat:lmp91000: change dev_err message Anderson Reis
2019-03-09 18:49   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).