device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all the other attributes, it is possible to switch all device driver instance to be constant. A coccinelle rule is used for this: @r_const_dev_1 disable optional_qualifier @ @@ -struct device * +const struct device * @r_const_dev_2 disable optional_qualifier @ @@ -struct device * const +const struct device * Fixes #27399 Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
parent
c8906fef79
commit
e18fcbba5a
1426 changed files with 9356 additions and 8368 deletions
|
@ -109,7 +109,7 @@ struct lis2dw12_data;
|
|||
|
||||
/* sensor data */
|
||||
struct lis2dw12_data {
|
||||
struct device *bus;
|
||||
const struct device *bus;
|
||||
int16_t acc[3];
|
||||
|
||||
/* save sensitivity */
|
||||
|
@ -117,7 +117,7 @@ struct lis2dw12_data {
|
|||
|
||||
stmdev_ctx_t *ctx;
|
||||
#ifdef CONFIG_LIS2DW12_TRIGGER
|
||||
struct device *gpio;
|
||||
const struct device *gpio;
|
||||
uint8_t gpio_pin;
|
||||
struct gpio_callback gpio_cb;
|
||||
sensor_trigger_handler_t drdy_handler;
|
||||
|
@ -131,7 +131,7 @@ struct lis2dw12_data {
|
|||
struct k_sem gpio_sem;
|
||||
#elif defined(CONFIG_LIS2DW12_TRIGGER_GLOBAL_THREAD)
|
||||
struct k_work work;
|
||||
struct device *dev;
|
||||
const struct device *dev;
|
||||
#endif /* CONFIG_LIS2DW12_TRIGGER_GLOBAL_THREAD */
|
||||
#endif /* CONFIG_LIS2DW12_TRIGGER */
|
||||
#if DT_INST_SPI_DEV_HAS_CS_GPIOS(0)
|
||||
|
@ -139,12 +139,12 @@ struct lis2dw12_data {
|
|||
#endif
|
||||
};
|
||||
|
||||
int lis2dw12_i2c_init(struct device *dev);
|
||||
int lis2dw12_spi_init(struct device *dev);
|
||||
int lis2dw12_i2c_init(const struct device *dev);
|
||||
int lis2dw12_spi_init(const struct device *dev);
|
||||
|
||||
#ifdef CONFIG_LIS2DW12_TRIGGER
|
||||
int lis2dw12_init_interrupt(struct device *dev);
|
||||
int lis2dw12_trigger_set(struct device *dev,
|
||||
int lis2dw12_init_interrupt(const struct device *dev);
|
||||
int lis2dw12_trigger_set(const struct device *dev,
|
||||
const struct sensor_trigger *trig,
|
||||
sensor_trigger_handler_t handler);
|
||||
#endif /* CONFIG_LIS2DW12_TRIGGER */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue