[PATCH] iio: light: si1133: fix an && vs || typo

Dan Carpenter
2018-07-31T18:11:34Z

The "val" variable can't be both 0 and 1 at the same time so this will
always return -EINVAL.

Fixes: e01e7eaf37d8 ("iio: light: introduce si1133")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/iio/light/si1133.c b/drivers/iio/light/si1133.c
index d3fbeb3bc463..5ac22c46da1f 100644
--- a/drivers/iio/light/si1133.c
+++ b/drivers/iio/light/si1133.c
@@ -838,7 +838,7 @@ static int si1133_write_raw(struct iio_dev *iio_dev,
switch (chan->type) {
case IIO_INTENSITY:
case IIO_UVINDEX:
- if (val != 0 || val != 1)
+ if (val != 0 && val != 1)
return -EINVAL;

return si1133_update_adcsens(data,