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>
This commit is contained in:
Julien Stephan
2024-10-31 16:26:56 +01:00
committed by Jonathan Cameron
parent 596ef5cf65
commit 04392fa8af

View File

@@ -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);