forked from kofal.net/zmk
refactor(app): replace struct device * with const struct device *
Replaced with RegExp: /(?<!const )(struct device \*)/g See: https://docs.zephyrproject.org/latest/releases/release-notes-2.4.html PR: #467
This commit is contained in:
@@ -19,7 +19,7 @@ extern struct ec11_data ec11_driver;
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(EC11, CONFIG_SENSOR_LOG_LEVEL);
|
||||
|
||||
static inline void setup_int(struct device *dev, bool enable) {
|
||||
static inline void setup_int(const struct device *dev, bool enable) {
|
||||
struct ec11_data *data = dev->data;
|
||||
const struct ec11_config *cfg = dev->config;
|
||||
|
||||
@@ -36,7 +36,8 @@ static inline void setup_int(struct device *dev, bool enable) {
|
||||
}
|
||||
}
|
||||
|
||||
static void ec11_a_gpio_callback(struct device *dev, struct gpio_callback *cb, uint32_t pins) {
|
||||
static void ec11_a_gpio_callback(const struct device *dev, struct gpio_callback *cb,
|
||||
uint32_t pins) {
|
||||
struct ec11_data *drv_data = CONTAINER_OF(cb, struct ec11_data, a_gpio_cb);
|
||||
|
||||
LOG_DBG("");
|
||||
@@ -50,7 +51,8 @@ static void ec11_a_gpio_callback(struct device *dev, struct gpio_callback *cb, u
|
||||
#endif
|
||||
}
|
||||
|
||||
static void ec11_b_gpio_callback(struct device *dev, struct gpio_callback *cb, uint32_t pins) {
|
||||
static void ec11_b_gpio_callback(const struct device *dev, struct gpio_callback *cb,
|
||||
uint32_t pins) {
|
||||
struct ec11_data *drv_data = CONTAINER_OF(cb, struct ec11_data, b_gpio_cb);
|
||||
|
||||
LOG_DBG("");
|
||||
@@ -65,7 +67,7 @@ static void ec11_b_gpio_callback(struct device *dev, struct gpio_callback *cb, u
|
||||
}
|
||||
|
||||
static void ec11_thread_cb(void *arg) {
|
||||
struct device *dev = arg;
|
||||
const struct device *dev = arg;
|
||||
struct ec11_data *drv_data = dev->data;
|
||||
|
||||
drv_data->handler(dev, drv_data->trigger);
|
||||
@@ -75,7 +77,7 @@ static void ec11_thread_cb(void *arg) {
|
||||
|
||||
#ifdef CONFIG_EC11_TRIGGER_OWN_THREAD
|
||||
static void ec11_thread(int dev_ptr, int unused) {
|
||||
struct device *dev = INT_TO_POINTER(dev_ptr);
|
||||
const struct device *dev = INT_TO_POINTER(dev_ptr);
|
||||
struct ec11_data *drv_data = dev->data;
|
||||
|
||||
ARG_UNUSED(unused);
|
||||
@@ -97,7 +99,7 @@ static void ec11_work_cb(struct k_work *work) {
|
||||
}
|
||||
#endif
|
||||
|
||||
int ec11_trigger_set(struct device *dev, const struct sensor_trigger *trig,
|
||||
int ec11_trigger_set(const struct device *dev, const struct sensor_trigger *trig,
|
||||
sensor_trigger_handler_t handler) {
|
||||
struct ec11_data *drv_data = dev->data;
|
||||
|
||||
@@ -113,7 +115,7 @@ int ec11_trigger_set(struct device *dev, const struct sensor_trigger *trig,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ec11_init_interrupt(struct device *dev) {
|
||||
int ec11_init_interrupt(const struct device *dev) {
|
||||
struct ec11_data *drv_data = dev->data;
|
||||
const struct ec11_config *drv_cfg = dev->config;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user