summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorJulien Stephan <jstephan@baylibre.com>2024-10-31 16:26:56 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-11-03 20:33:43 +0000
commit04392fa8af5ae770469abb7c032109ce33075ce1 (patch)
tree8db2256fae2d532cc2058fc3372762d80d331522 /drivers/iio
parent596ef5cf654b7c8cbdbb42f890063f868357acac (diff)
downloadlinux-stable-04392fa8af5ae770469abb7c032109ce33075ce1.tar.gz
linux-stable-04392fa8af5ae770469abb7c032109ce33075ce1.tar.bz2
linux-stable-04392fa8af5ae770469abb7c032109ce33075ce1.zip
iio: light: ltr390: simplify code in write_event_config callback
iio_ev_state_store is actually using kstrtobool to check user input, then gives the converted boolean value to the write_event_config callback. Remove useless code in write_event_config callback. Signed-off-by: Julien Stephan <jstephan@baylibre.com> Link: https://patch.msgid.link/20241031-iio-fix-write-event-config-signature-v2-1-2bcacbb517a2@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/light/ltr390.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iio/light/ltr390.c b/drivers/iio/light/ltr390.c
index 8e0a3fc3d923..3bdffb6360bc 100644
--- a/drivers/iio/light/ltr390.c
+++ b/drivers/iio/light/ltr390.c
@@ -558,10 +558,7 @@ static int ltr390_write_event_config(struct iio_dev *indio_dev,
struct ltr390_data *data = iio_priv(indio_dev);
int ret;
- if (state != 1 && state != 0)
- return -EINVAL;
-
- if (state == 0)
+ if (!state)
return regmap_clear_bits(data->regmap, LTR390_INT_CFG, LTR390_LS_INT_EN);
guard(mutex)(&data->lock);