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: accel: mma9551: use bool for event state

Since the write_event_config callback now uses a bool for the state
parameter, update the signature of the function it calls accordingly,
and use a bool array for event_enabled.

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

authored by

Julien Stephan and committed by
Jonathan Cameron
1d308645 b4b42f28

+3 -3
+3 -3
drivers/iio/accel/mma9551.c
··· 45 45 struct mma9551_data { 46 46 struct i2c_client *client; 47 47 struct mutex mutex; 48 - int event_enabled[3]; 48 + bool event_enabled[3]; 49 49 int irqs[MMA9551_GPIO_COUNT]; 50 50 }; 51 51 ··· 162 162 163 163 static int mma9551_config_incli_event(struct iio_dev *indio_dev, 164 164 enum iio_modifier axis, 165 - int state) 165 + bool state) 166 166 { 167 167 struct mma9551_data *data = iio_priv(indio_dev); 168 168 enum mma9551_tilt_axis mma_axis; ··· 174 174 if (data->event_enabled[mma_axis] == state) 175 175 return 0; 176 176 177 - if (state == 0) { 177 + if (!state) { 178 178 ret = mma9551_gpio_config(data->client, 179 179 (enum mma9551_gpio_pin)mma_axis, 180 180 MMA9551_APPID_NONE, 0, 0);