diff mbox series

[5/5] iio:potentiostat:lmp91000: add '\n' on dev_err

Message ID 20190218172236.7781-6-lucasseikioshiro@gmail.com (mailing list archive)
State New, archived
Headers show
Series iio:potentiostat:lmp91000: Adjust codestyle, and minor cleanup changes | expand

Commit Message

Lucas Seiki Oshiro Feb. 18, 2019, 5:22 p.m. UTC
Add missing '\n' at the end of dev_err message on line 215.

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(-)

Comments

Joe Perches Feb. 18, 2019, 9:01 p.m. UTC | #1
On Mon, 2019-02-18 at 14:22 -0300, Lucas Oshiro wrote:
> Add missing '\n' at the end of dev_err message on line 215.
[]
> diff --git 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\n");

Perhaps a copy/paste error as the test is for
external-tia-resistor and not tia-gain-ohm
Jonathan Cameron Feb. 20, 2019, 9:49 a.m. UTC | #2
On Mon, 18 Feb 2019 13:01:23 -0800
Joe Perches <joe@perches.com> wrote:

> On Mon, 2019-02-18 at 14:22 -0300, Lucas Oshiro wrote:
> > Add missing '\n' at the end of dev_err message on line 215.  
> []
> > diff --git 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\n");  
> 
> Perhaps a copy/paste error as the test is for
> external-tia-resistor and not tia-gain-ohm
> 
It is an odd construct, but I think this is correct.  What it is actually
saying is that, given that we don't have an external resistor, we care
that the tia-gain-ohm isn't set (otherwise it wouldn't matter).

From the docs
  - ti,external-tia-resistor: if the property ti,tia-gain-ohm is not defined this
    needs to be set to signal that an external resistor value is being used.

So, it might be ideal to say that tia-gain-ohm is not defined and we do
not have an external resistor specified.

So not wrong, but could be more informative!  So perhaps a follow up patch
to tidy that up would be good.

Jonathan
>
Joe Perches Feb. 20, 2019, 10:22 p.m. UTC | #3
On Wed, 2019-02-20 at 09:49 +0000, Jonathan Cameron wrote:
> On Mon, 18 Feb 2019 13:01:23 -0800 Joe Perches <joe@perches.com> wrote:
> > On Mon, 2019-02-18 at 14:22 -0300, Lucas Oshiro wrote:
> > > Add missing '\n' at the end of dev_err message on line 215.  
> > []
> > > diff --git 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\n");  
> > 
> > Perhaps a copy/paste error as the test is for
> > external-tia-resistor and not tia-gain-ohm
> > 
> It is an odd construct, but I think this is correct.  What it is actually
> saying is that, given that we don't have an external resistor, we care
> that the tia-gain-ohm isn't set (otherwise it wouldn't matter).
> 
> From the docs
>   - ti,external-tia-resistor: if the property ti,tia-gain-ohm is not defined this
>     needs to be set to signal that an external resistor value is being used.
> 
> So, it might be ideal to say that tia-gain-ohm is not defined and we do
> not have an external resistor specified.
> 
> So not wrong, but could be more informative!  So perhaps a follow up patch
> to tidy that up would be good.

Then thanks in advance for doing that.
cheers, Joe
Lucas Seiki Oshiro Feb. 26, 2019, 8:15 p.m. UTC | #4
Thanks for the review!

On 20/02/2019 19:22, Joe Perches wrote:
> On Wed, 2019-02-20 at 09:49 +0000, Jonathan Cameron wrote:
>> On Mon, 18 Feb 2019 13:01:23 -0800 Joe Perches <joe@perches.com> wrote:
>>> On Mon, 2019-02-18 at 14:22 -0300, Lucas Oshiro wrote:
>>>> Add missing '\n' at the end of dev_err message on line 215.
>>> []
>>>> diff --git 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\n");
>>>
>>> Perhaps a copy/paste error as the test is for
>>> external-tia-resistor and not tia-gain-ohm
>>>
>> It is an odd construct, but I think this is correct.  What it is actually
>> saying is that, given that we don't have an external resistor, we care
>> that the tia-gain-ohm isn't set (otherwise it wouldn't matter).
>>
>>  From the docs
>>    - ti,external-tia-resistor: if the property ti,tia-gain-ohm is not defined this
>>      needs to be set to signal that an external resistor value is being used.
>>
>> So, it might be ideal to say that tia-gain-ohm is not defined and we do
>> not have an external resistor specified.
>>
>> So not wrong, but could be more informative!  So perhaps a follow up patch
>> to tidy that up would be good.

So, this means that it's a good idea to change the dev_err message to something
like "no ti,tia-gain-ohm defined and external resistor not specified"?

> 
> Then thanks in advance for doing that.
> cheers, Joe
>
Jonathan Cameron March 3, 2019, 4:49 p.m. UTC | #5
On Tue, 26 Feb 2019 17:15:52 -0300
Lucas Oshiro <lucasseikioshiro@gmail.com> wrote:

> Thanks for the review!
> 
> On 20/02/2019 19:22, Joe Perches wrote:
> > On Wed, 2019-02-20 at 09:49 +0000, Jonathan Cameron wrote:  
> >> On Mon, 18 Feb 2019 13:01:23 -0800 Joe Perches <joe@perches.com> wrote:  
> >>> On Mon, 2019-02-18 at 14:22 -0300, Lucas Oshiro wrote:  
> >>>> Add missing '\n' at the end of dev_err message on line 215.  
> >>> []  
> >>>> diff --git 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\n");  
> >>>
> >>> Perhaps a copy/paste error as the test is for
> >>> external-tia-resistor and not tia-gain-ohm
> >>>  
> >> It is an odd construct, but I think this is correct.  What it is actually
> >> saying is that, given that we don't have an external resistor, we care
> >> that the tia-gain-ohm isn't set (otherwise it wouldn't matter).
> >>
> >>  From the docs
> >>    - ti,external-tia-resistor: if the property ti,tia-gain-ohm is not defined this
> >>      needs to be set to signal that an external resistor value is being used.
> >>
> >> So, it might be ideal to say that tia-gain-ohm is not defined and we do
> >> not have an external resistor specified.
> >>
> >> So not wrong, but could be more informative!  So perhaps a follow up patch
> >> to tidy that up would be good.  
> 
> So, this means that it's a good idea to change the dev_err message to something
> like "no ti,tia-gain-ohm defined and external resistor not specified"?

Exactly.  Thanks,

Jonathan
> 
> > 
> > Then thanks in advance for doing that.
> > cheers, Joe
> >
diff mbox series

Patch

diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
index 7229ef59590a..aecdda757586 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\n");
 			return ret;
 		}
 		val = 0;