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: proximity: sx9500: 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-5-2bcacbb517a2@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Julien Stephan and committed by
Jonathan Cameron
18aa930a 63023e8a

+2 -2
+2 -2
drivers/iio/proximity/sx9500.c
··· 551 551 552 552 mutex_lock(&data->mutex); 553 553 554 - if (state == 1) { 554 + if (state) { 555 555 ret = sx9500_inc_chan_users(data, chan->channel); 556 556 if (ret < 0) 557 557 goto out_unlock; ··· 571 571 goto out_unlock; 572 572 573 573 out_undo_chan: 574 - if (state == 1) 574 + if (state) 575 575 sx9500_dec_chan_users(data, chan->channel); 576 576 else 577 577 sx9500_inc_chan_users(data, chan->channel);