Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Julien Stephan and committed by
Jonathan Cameron
04392fa8 596ef5cf

+1 -4
+1 -4
drivers/iio/light/ltr390.c
··· 558 558 struct ltr390_data *data = iio_priv(indio_dev); 559 559 int ret; 560 560 561 - if (state != 1 && state != 0) 562 - return -EINVAL; 563 - 564 - if (state == 0) 561 + if (!state) 565 562 return regmap_clear_bits(data->regmap, LTR390_INT_CFG, LTR390_LS_INT_EN); 566 563 567 564 guard(mutex)(&data->lock);