linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Johan Hovold <jhovold@gmail.com>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/3] iio: light: lm3533-als: Print error message on invalid resistance
Date: Wed, 28 Oct 2015 11:53:06 -0700	[thread overview]
Message-ID: <1446058386.2757.145.camel@perches.com> (raw)
In-Reply-To: <20151028183750.GB24668@usrtlx11787.corpusers.net>

On Wed, 2015-10-28 at 11:37 -0700, Bjorn Andersson wrote:
> On Tue 27 Oct 12:18 PDT 2015, Joe Perches wrote:
> > On Sun, 2015-10-25 at 11:09 -0700, Bjorn Andersson wrote:
> > > Print an error message to indicate that invalid configuration data was
> > > provided in the platform_data, rather than just aborting initialization.
> > Perhaps it'd be nicer to show the 3 values.
> I do agree that it would be helpful to hint the developer about the
> expected range. The problem I see here though is that, in the case of
> devicetree we've now moved from resistance to a register value.
[]
> So would you be okay with not improving the message? Or would you like
> me to just move it into the code in patch 1 - and leave the
> platform_data case as it was (with a silent failure)?
[]
> > > diff --git a/drivers/iio/light/lm3533-als.c b/drivers/iio/light/lm3533-als.c
> > []
> > > @@ -743,8 +743,10 @@ static int lm3533_als_set_resistor(struct lm3533_als *als, u8 val)
> > >  {
> > >  	int ret;
> > >  
> > > -	if (val < LM3533_ALS_RESISTOR_MIN || val > LM3533_ALS_RESISTOR_MAX)
> > > +	if (val < LM3533_ALS_RESISTOR_MIN || val > LM3533_ALS_RESISTOR_MAX) {
> > > +		dev_err(&als->pdev->dev, "invalid resistor value\n");
> > >  		return -EINVAL;
> > > +	};
> > >  

What I suggested was just a trivial proposal.
Whatever you do is fine with me.



  reply	other threads:[~2015-10-28 18:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-25 18:09 [PATCH 1/3] devicetree: mfd: Add binding for the TI LM3533 Bjorn Andersson
2015-10-25 18:09 ` [PATCH 2/3] iio: light: lm3533-als: Print error message on invalid resistance Bjorn Andersson
2015-10-27 19:18   ` Joe Perches
2015-10-28 18:37     ` Bjorn Andersson
2015-10-28 18:53       ` Joe Perches [this message]
2015-10-25 18:09 ` [PATCH 3/3] mfd: lm3533: Support initialization from Device Tree Bjorn Andersson
2015-10-27  7:57 ` [PATCH 1/3] devicetree: mfd: Add binding for the TI LM3533 Rob Herring
2015-10-27 16:29 ` [PATCH v2 " Bjorn Andersson
2015-10-27 16:29   ` [PATCH v2 2/3] iio: light: lm3533-als: Print error message on invalid resistance Bjorn Andersson
2015-10-27 16:29   ` [PATCH v2 3/3] mfd: lm3533: Support initialization from Device Tree Bjorn Andersson
2015-10-27 16:43     ` kbuild test robot
2015-10-27 16:53     ` kbuild test robot
2015-10-28 11:40     ` Lee Jones
2015-10-28 11:50       ` Joe Perches
2015-10-28 18:41       ` Bjorn Andersson
2015-10-27 19:21   ` [PATCH v2 1/3] devicetree: mfd: Add binding for the TI LM3533 Rob Herring
2015-10-30 18:42   ` Lee Jones
2015-10-30 19:41     ` Bjorn Andersson
2015-10-30 20:18       ` Rob Herring
2015-10-30 21:16         ` Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1446058386.2757.145.camel@perches.com \
    --to=joe@perches.com \
    --cc=bjorn.andersson@sonymobile.com \
    --cc=jhovold@gmail.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).