diff options
author | Julien Stephan <jstephan@baylibre.com> | 2024-10-31 16:27:03 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-11-03 20:33:44 +0000 |
commit | 1d3086459da392ac80889133e9549fa7e041b9f1 (patch) | |
tree | e6189bb430c2a0099c4e949e4876729b4d022d25 /drivers/iio | |
parent | b4b42f28a0df6b9d31f0003f7dea3bddf272eaa4 (diff) | |
download | linux-stable-1d3086459da392ac80889133e9549fa7e041b9f1.tar.gz linux-stable-1d3086459da392ac80889133e9549fa7e041b9f1.tar.bz2 linux-stable-1d3086459da392ac80889133e9549fa7e041b9f1.zip |
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>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/accel/mma9551.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iio/accel/mma9551.c b/drivers/iio/accel/mma9551.c index 605022f5239a..6d73eec95126 100644 --- a/drivers/iio/accel/mma9551.c +++ b/drivers/iio/accel/mma9551.c @@ -45,7 +45,7 @@ enum mma9551_tilt_axis { struct mma9551_data { struct i2c_client *client; struct mutex mutex; - int event_enabled[3]; + bool event_enabled[3]; int irqs[MMA9551_GPIO_COUNT]; }; @@ -162,7 +162,7 @@ static int mma9551_read_event_config(struct iio_dev *indio_dev, static int mma9551_config_incli_event(struct iio_dev *indio_dev, enum iio_modifier axis, - int state) + bool state) { struct mma9551_data *data = iio_priv(indio_dev); enum mma9551_tilt_axis mma_axis; @@ -174,7 +174,7 @@ static int mma9551_config_incli_event(struct iio_dev *indio_dev, if (data->event_enabled[mma_axis] == state) return 0; - if (state == 0) { + if (!state) { ret = mma9551_gpio_config(data->client, (enum mma9551_gpio_pin)mma_axis, MMA9551_APPID_NONE, 0, 0); |