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

Since the write_event_config callback now uses a bool for the state
parameter, update apds9300_set_intr_state accordingly and change intr_en
to bool.

Also update apds9300_set_power_state and power_state for consistency.

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

authored by

Julien Stephan and committed by
Jonathan Cameron
ad531aa4 3121da85

+9 -9
+9 -9
drivers/iio/light/apds9300.c
··· 46 46 struct apds9300_data { 47 47 struct i2c_client *client; 48 48 struct mutex mutex; 49 - int power_state; 49 + bool power_state; 50 50 int thresh_low; 51 51 int thresh_hi; 52 - int intr_en; 52 + bool intr_en; 53 53 }; 54 54 55 55 /* Lux calculation */ ··· 148 148 return 0; 149 149 } 150 150 151 - static int apds9300_set_intr_state(struct apds9300_data *data, int state) 151 + static int apds9300_set_intr_state(struct apds9300_data *data, bool state) 152 152 { 153 153 int ret; 154 154 u8 cmd; ··· 169 169 return 0; 170 170 } 171 171 172 - static int apds9300_set_power_state(struct apds9300_data *data, int state) 172 + static int apds9300_set_power_state(struct apds9300_data *data, bool state) 173 173 { 174 174 int ret; 175 175 u8 cmd; ··· 221 221 * Disable interrupt to ensure thai it is doesn't enable 222 222 * i.e. after device soft reset 223 223 */ 224 - ret = apds9300_set_intr_state(data, 0); 224 + ret = apds9300_set_intr_state(data, false); 225 225 if (ret < 0) 226 226 goto err; 227 227 ··· 459 459 iio_device_unregister(indio_dev); 460 460 461 461 /* Ensure that power off and interrupts are disabled */ 462 - apds9300_set_intr_state(data, 0); 463 - apds9300_set_power_state(data, 0); 462 + apds9300_set_intr_state(data, false); 463 + apds9300_set_power_state(data, false); 464 464 } 465 465 466 466 static int apds9300_suspend(struct device *dev) ··· 470 470 int ret; 471 471 472 472 mutex_lock(&data->mutex); 473 - ret = apds9300_set_power_state(data, 0); 473 + ret = apds9300_set_power_state(data, false); 474 474 mutex_unlock(&data->mutex); 475 475 476 476 return ret; ··· 483 483 int ret; 484 484 485 485 mutex_lock(&data->mutex); 486 - ret = apds9300_set_power_state(data, 1); 486 + ret = apds9300_set_power_state(data, true); 487 487 mutex_unlock(&data->mutex); 488 488 489 489 return ret;