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-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/3] iio: light: lm3533-als: Print error message on invalid resistance
Date: Tue, 27 Oct 2015 12:18:27 -0700	[thread overview]
Message-ID: <1445973507.2757.40.camel@perches.com> (raw)
In-Reply-To: <1445796586-28683-2-git-send-email-bjorn.andersson@sonymobile.com>

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.

> 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;
> +	};
>  
>  	ret = lm3533_write(als->lm3533, LM3533_REG_ALS_RESISTOR_SELECT, val);
>  	if (ret) {




  reply	other threads:[~2015-10-27 19:18 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 [this message]
2015-10-28 18:37     ` Bjorn Andersson
2015-10-28 18:53       ` Joe Perches
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=1445973507.2757.40.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).