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:
@@ -34,10 +34,10 @@ struct kscan_composite_config {};
|
||||
struct kscan_composite_data {
|
||||
kscan_callback_t callback;
|
||||
|
||||
struct device *dev;
|
||||
const struct device *dev;
|
||||
};
|
||||
|
||||
static int kscan_composite_enable_callback(struct device *dev) {
|
||||
static int kscan_composite_enable_callback(const struct device *dev) {
|
||||
for (int i = 0; i < ARRAY_SIZE(kscan_composite_children); i++) {
|
||||
const struct kscan_composite_child_config *cfg = &kscan_composite_children[i];
|
||||
|
||||
@@ -46,7 +46,7 @@ static int kscan_composite_enable_callback(struct device *dev) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int kscan_composite_disable_callback(struct device *dev) {
|
||||
static int kscan_composite_disable_callback(const struct device *dev) {
|
||||
for (int i = 0; i < ARRAY_SIZE(kscan_composite_children); i++) {
|
||||
const struct kscan_composite_child_config *cfg = &kscan_composite_children[i];
|
||||
|
||||
@@ -55,10 +55,10 @@ static int kscan_composite_disable_callback(struct device *dev) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void kscan_composite_child_callback(struct device *child_dev, uint32_t row, uint32_t column,
|
||||
bool pressed) {
|
||||
static void kscan_composite_child_callback(const struct device *child_dev, uint32_t row,
|
||||
uint32_t column, bool pressed) {
|
||||
// TODO: Ideally we can get this passed into our callback!
|
||||
struct device *dev = device_get_binding(DT_INST_LABEL(0));
|
||||
const struct device *dev = device_get_binding(DT_INST_LABEL(0));
|
||||
struct kscan_composite_data *data = dev->data;
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(kscan_composite_children); i++) {
|
||||
@@ -72,7 +72,7 @@ static void kscan_composite_child_callback(struct device *child_dev, uint32_t ro
|
||||
}
|
||||
}
|
||||
|
||||
static int kscan_composite_configure(struct device *dev, kscan_callback_t callback) {
|
||||
static int kscan_composite_configure(const struct device *dev, kscan_callback_t callback) {
|
||||
struct kscan_composite_data *data = dev->data;
|
||||
|
||||
if (!callback) {
|
||||
@@ -90,7 +90,7 @@ static int kscan_composite_configure(struct device *dev, kscan_callback_t callba
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int kscan_composite_init(struct device *dev) {
|
||||
static int kscan_composite_init(const struct device *dev) {
|
||||
struct kscan_composite_data *data = dev->data;
|
||||
|
||||
data->dev = dev;
|
||||
|
||||
Reference in New Issue
Block a user