summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorJulien Stephan <jstephan@baylibre.com>2024-10-31 16:26:58 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-11-03 20:33:43 +0000
commite41edccbfc34d2fd4f2c52a9159ed4f429d419f5 (patch)
tree053671b9b44073848b499cace075df01c2644eb6 /drivers/iio
parent122679a62f2446b44a35aa8b54cb0240e0a5dab0 (diff)
downloadlinux-stable-e41edccbfc34d2fd4f2c52a9159ed4f429d419f5.tar.gz
linux-stable-e41edccbfc34d2fd4f2c52a9159ed4f429d419f5.tar.bz2
linux-stable-e41edccbfc34d2fd4f2c52a9159ed4f429d419f5.zip
iio: light: tsl2772: 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-3-2bcacbb517a2@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/light/tsl2772.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/light/tsl2772.c b/drivers/iio/light/tsl2772.c
index cab468a82b61..26082f239c4c 100644
--- a/drivers/iio/light/tsl2772.c
+++ b/drivers/iio/light/tsl2772.c
@@ -1086,9 +1086,9 @@ static int tsl2772_write_interrupt_config(struct iio_dev *indio_dev,
struct tsl2772_chip *chip = iio_priv(indio_dev);
if (chan->type == IIO_INTENSITY)
- chip->settings.als_interrupt_en = val ? true : false;
+ chip->settings.als_interrupt_en = val;
else
- chip->settings.prox_interrupt_en = val ? true : false;
+ chip->settings.prox_interrupt_en = val;
return tsl2772_invoke_change(indio_dev);
}