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: adux1020: write_event_config: use local variable for interrupt value

state parameter is currently an int, but it is actually a boolean.
iio_ev_state_store is actually using kstrtobool to check user input,
then gives the converted boolean value to write_event_config. The code
in adux1020_write_event_config re-uses state parameter to store an
integer value. To prepare for updating the write_event_config signature
to use a boolean for state, introduce a new local int variable.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20241031-iio-fix-write-event-config-signature-v2-6-2bcacbb517a2@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Julien Stephan and committed by
Jonathan Cameron
2cc86e94 18aa930a

+4 -5
+4 -5
drivers/iio/light/adux1020.c
··· 526 526 mask = ADUX1020_PROX_OFF1_INT; 527 527 528 528 if (state) 529 - state = 0; 529 + ret = regmap_clear_bits(data->regmap, 530 + ADUX1020_REG_INT_MASK, mask); 530 531 else 531 - state = mask; 532 - 533 - ret = regmap_update_bits(data->regmap, ADUX1020_REG_INT_MASK, 534 - mask, state); 532 + ret = regmap_set_bits(data->regmap, 533 + ADUX1020_REG_INT_MASK, mask); 535 534 if (ret < 0) 536 535 goto fail; 537 536