drivers: gpio: fix const qualifier on driver data pointers
Several declarations provided a const pointer to mutable data. Change all declarations that are not used to change the invert field to be pointers to const data. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
c273b5d885
commit
9d41d53927
1 changed files with 8 additions and 8 deletions
|
@ -638,8 +638,8 @@ static inline int z_impl_gpio_pin_interrupt_configure(struct device *port,
|
|||
{
|
||||
const struct gpio_driver_api *api =
|
||||
(const struct gpio_driver_api *)port->driver_api;
|
||||
struct gpio_driver_data *const data =
|
||||
(struct gpio_driver_data *const)port->driver_data;
|
||||
const struct gpio_driver_data *const data =
|
||||
(const struct gpio_driver_data *)port->driver_data;
|
||||
enum gpio_int_trig trig;
|
||||
enum gpio_int_mode mode;
|
||||
|
||||
|
@ -798,8 +798,8 @@ static inline int z_impl_gpio_port_get_raw(struct device *port,
|
|||
*/
|
||||
static inline int gpio_port_get(struct device *port, gpio_port_value_t *value)
|
||||
{
|
||||
struct gpio_driver_data *const data =
|
||||
(struct gpio_driver_data *const)port->driver_data;
|
||||
const struct gpio_driver_data *const data =
|
||||
(const struct gpio_driver_data *)port->driver_data;
|
||||
int ret;
|
||||
|
||||
ret = gpio_port_get_raw(port, value);
|
||||
|
@ -862,8 +862,8 @@ static inline int z_impl_gpio_port_set_masked_raw(struct device *port,
|
|||
static inline int gpio_port_set_masked(struct device *port,
|
||||
gpio_port_pins_t mask, gpio_port_value_t value)
|
||||
{
|
||||
struct gpio_driver_data *const data =
|
||||
(struct gpio_driver_data *const)port->driver_data;
|
||||
const struct gpio_driver_data *const data =
|
||||
(const struct gpio_driver_data *)port->driver_data;
|
||||
|
||||
value ^= data->invert;
|
||||
|
||||
|
@ -1122,8 +1122,8 @@ static inline int gpio_pin_set_raw(struct device *port, unsigned int pin,
|
|||
*/
|
||||
static inline int gpio_pin_set(struct device *port, unsigned int pin, int value)
|
||||
{
|
||||
struct gpio_driver_data *const data =
|
||||
(struct gpio_driver_data *const)port->driver_data;
|
||||
const struct gpio_driver_data *const data =
|
||||
(const struct gpio_driver_data *)port->driver_data;
|
||||
|
||||
__ASSERT(pin < GPIO_MAX_PINS_PER_PORT, "Invalid pin number");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue