public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: bjorn.andersson@sonymobile.com (Bjorn Andersson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 2/3] iio: light: lm3533-als: Print error message on invalid resistance
Date: Fri, 30 Oct 2015 16:50:39 -0700	[thread overview]
Message-ID: <1446249040-16552-2-git-send-email-bjorn.andersson@sonymobile.com> (raw)
In-Reply-To: <1446249040-16552-1-git-send-email-bjorn.andersson@sonymobile.com>

Print an error message to indicate that invalid configuration data was
provided in the platform_data, rather than just aborting initialization.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
---

This patch can be picked independently of the other 2, but included in the
series for "completeness".

No changes since v1 in this patch.

 drivers/iio/light/lm3533-als.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/light/lm3533-als.c b/drivers/iio/light/lm3533-als.c
index 076bc46fad03..e56937c40a18 100644
--- 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) {
-- 
2.4.2

  reply	other threads:[~2015-10-30 23:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-30 23:50 [PATCH v3 1/3] devicetree: mfd: Add binding for the TI LM3533 Bjorn Andersson
2015-10-30 23:50 ` Bjorn Andersson [this message]
2015-10-31 10:06   ` [PATCH v3 2/3] iio: light: lm3533-als: Print error message on invalid resistance Jonathan Cameron
2015-10-30 23:50 ` [PATCH v3 3/3] mfd: lm3533: Support initialization from Device Tree Bjorn Andersson
2015-10-31 10:08 ` [PATCH v3 1/3] devicetree: mfd: Add binding for the TI LM3533 Jonathan Cameron
2015-11-06  2:23 ` Rob Herring

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=1446249040-16552-2-git-send-email-bjorn.andersson@sonymobile.com \
    --to=bjorn.andersson@sonymobile.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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