From: Julien Stephan Date: Thu, 31 Oct 2024 15:26:56 +0000 (+0100) Subject: iio: light: ltr390: simplify code in write_event_config callback X-Git-Tag: ceph-for-6.13-rc4~120^2~11^2~33 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=04392fa8af5ae770469abb7c032109ce33075ce1;p=ceph-client.git 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 Link: https://patch.msgid.link/20241031-iio-fix-write-event-config-signature-v2-1-2bcacbb517a2@baylibre.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/light/ltr390.c b/drivers/iio/light/ltr390.c index 8e0a3fc3d923a..3bdffb6360bcb 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);