summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorJulien Stephan <jstephan@baylibre.com>2024-10-31 16:27:08 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-11-03 20:33:44 +0000
commit86b8843ee2bb8038f3c648cd9e7f3b787fad3ea3 (patch)
tree9dad3b3596b3808cdc799610194864630bcaddc4 /drivers/iio
parentad531aa484f74ec51465deee44dec77ea721a2ed (diff)
downloadlinux-stable-86b8843ee2bb8038f3c648cd9e7f3b787fad3ea3.tar.gz
linux-stable-86b8843ee2bb8038f3c648cd9e7f3b787fad3ea3.tar.bz2
linux-stable-86b8843ee2bb8038f3c648cd9e7f3b787fad3ea3.zip
iio: light: apds9306: simplifies if branch in apds9306_write_event_config
Simplifies the regmap_wite if branch in apds9306_write_event_config. Signed-off-by: Julien Stephan <jstephan@baylibre.com> Link: https://patch.msgid.link/20241031-iio-fix-write-event-config-signature-v2-13-2bcacbb517a2@baylibre.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/light/apds9306.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/iio/light/apds9306.c b/drivers/iio/light/apds9306.c
index 8adc74040db2..9c08e7c3ad0c 100644
--- a/drivers/iio/light/apds9306.c
+++ b/drivers/iio/light/apds9306.c
@@ -1125,10 +1125,7 @@ static int apds9306_write_event_config(struct iio_dev *indio_dev,
}
}
case IIO_EV_TYPE_THRESH_ADAPTIVE:
- if (state)
- return regmap_field_write(rf->int_thresh_var_en, 1);
- else
- return regmap_field_write(rf->int_thresh_var_en, 0);
+ return regmap_field_write(rf->int_thresh_var_en, state);
default:
return -EINVAL;
}