Commit 18fb1ab0 authored by Bjorn Andersson's avatar Bjorn Andersson Committed by Jonathan Cameron

iio: light: lm3533-als: Print error message on invalid resistance

Print an error message to indicate that invalid configuration data was
provided in the platform_data, rather than just aborting initialization.
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 2d6ca60f
...@@ -743,8 +743,10 @@ static int lm3533_als_set_resistor(struct lm3533_als *als, u8 val) ...@@ -743,8 +743,10 @@ static int lm3533_als_set_resistor(struct lm3533_als *als, u8 val)
{ {
int ret; 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; return -EINVAL;
};
ret = lm3533_write(als->lm3533, LM3533_REG_ALS_RESISTOR_SELECT, val); ret = lm3533_write(als->lm3533, LM3533_REG_ALS_RESISTOR_SELECT, val);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment