From: Bjorn Andersson <bjorn.andersson@sonymobile.com>
To: 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>
Cc: <linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: [PATCH 2/3] iio: light: lm3533-als: Print error message on invalid resistance
Date: Sun, 25 Oct 2015 11:09:45 -0700 [thread overview]
Message-ID: <1445796586-28683-2-git-send-email-bjorn.andersson@sonymobile.com> (raw)
In-Reply-To: <1445796586-28683-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".
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
next prev parent reply other threads:[~2015-10-25 18:10 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 ` Bjorn Andersson [this message]
2015-10-27 19:18 ` [PATCH 2/3] iio: light: lm3533-als: Print error message on invalid resistance Joe Perches
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=1445796586-28683-2-git-send-email-bjorn.andersson@sonymobile.com \
--to=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).