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
|
@ -7,71 +7,76 @@
|
|||
#include <drivers/gpio.h>
|
||||
#include <syscall_handler.h>
|
||||
|
||||
static inline int z_vrfy_gpio_config(struct device *port,
|
||||
static inline int z_vrfy_gpio_config(const struct device *port,
|
||||
gpio_pin_t pin, gpio_flags_t flags)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, pin_configure));
|
||||
return z_impl_gpio_config((struct device *)port, pin, flags);
|
||||
return z_impl_gpio_config((const struct device *)port, pin, flags);
|
||||
}
|
||||
#include <syscalls/gpio_config_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_gpio_port_get_raw(struct device *port,
|
||||
static inline int z_vrfy_gpio_port_get_raw(const struct device *port,
|
||||
gpio_port_value_t *value)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_get_raw));
|
||||
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(value, sizeof(gpio_port_value_t)));
|
||||
return z_impl_gpio_port_get_raw((struct device *)port,
|
||||
return z_impl_gpio_port_get_raw((const struct device *)port,
|
||||
(gpio_port_value_t *)value);
|
||||
}
|
||||
#include <syscalls/gpio_port_get_raw_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_gpio_port_set_masked_raw(struct device *port,
|
||||
gpio_port_pins_t mask, gpio_port_value_t value)
|
||||
static inline int z_vrfy_gpio_port_set_masked_raw(const struct device *port,
|
||||
gpio_port_pins_t mask,
|
||||
gpio_port_value_t value)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_set_masked_raw));
|
||||
return z_impl_gpio_port_set_masked_raw((struct device *)port, mask,
|
||||
return z_impl_gpio_port_set_masked_raw((const struct device *)port,
|
||||
mask,
|
||||
value);
|
||||
}
|
||||
#include <syscalls/gpio_port_set_masked_raw_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_gpio_port_set_bits_raw(struct device *port,
|
||||
static inline int z_vrfy_gpio_port_set_bits_raw(const struct device *port,
|
||||
gpio_port_pins_t pins)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_set_bits_raw));
|
||||
return z_impl_gpio_port_set_bits_raw((struct device *)port, pins);
|
||||
return z_impl_gpio_port_set_bits_raw((const struct device *)port,
|
||||
pins);
|
||||
}
|
||||
#include <syscalls/gpio_port_set_bits_raw_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_gpio_port_clear_bits_raw(struct device *port,
|
||||
static inline int z_vrfy_gpio_port_clear_bits_raw(const struct device *port,
|
||||
gpio_port_pins_t pins)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_clear_bits_raw));
|
||||
return z_impl_gpio_port_clear_bits_raw((struct device *)port, pins);
|
||||
return z_impl_gpio_port_clear_bits_raw((const struct device *)port,
|
||||
pins);
|
||||
}
|
||||
#include <syscalls/gpio_port_clear_bits_raw_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_gpio_port_toggle_bits(struct device *port,
|
||||
static inline int z_vrfy_gpio_port_toggle_bits(const struct device *port,
|
||||
gpio_port_pins_t pins)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, port_toggle_bits));
|
||||
return z_impl_gpio_port_toggle_bits((struct device *)port, pins);
|
||||
return z_impl_gpio_port_toggle_bits((const struct device *)port, pins);
|
||||
}
|
||||
#include <syscalls/gpio_port_toggle_bits_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_gpio_pin_interrupt_configure(struct device *port,
|
||||
static inline int z_vrfy_gpio_pin_interrupt_configure(const struct device *port,
|
||||
gpio_pin_t pin,
|
||||
gpio_flags_t flags)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(port, pin_interrupt_configure));
|
||||
return z_impl_gpio_pin_interrupt_configure((struct device *)port, pin,
|
||||
return z_impl_gpio_pin_interrupt_configure((const struct device *)port,
|
||||
pin,
|
||||
flags);
|
||||
}
|
||||
#include <syscalls/gpio_pin_interrupt_configure_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_gpio_get_pending_int(struct device *dev)
|
||||
static inline int z_vrfy_gpio_get_pending_int(const struct device *dev)
|
||||
{
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_GPIO(dev, get_pending_int));
|
||||
|
||||
return z_impl_gpio_get_pending_int((struct device *)dev);
|
||||
return z_impl_gpio_get_pending_int((const struct device *)dev);
|
||||
}
|
||||
#include <syscalls/gpio_get_pending_int_mrsh.c>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue