fix(drivers): Proper static/const for data/config (#2769)

Save a tiny bit of RAM by properly marking our device config
struct instances const consistently, and also add missing static
modifiers to properly isolate config/data for drivers.
This commit is contained in:
Pete Johanson
2025-01-15 10:35:35 -07:00
committed by GitHub
parent 700e9b264f
commit 6941abc2af
9 changed files with 14 additions and 17 deletions

View File

@@ -445,7 +445,7 @@ static const struct kscan_driver_api kscan_charlieplex_api = {
.charlieplex_state = kscan_charlieplex_state_##n, \
}; \
\
static struct kscan_charlieplex_config kscan_charlieplex_config_##n = { \
static const struct kscan_charlieplex_config kscan_charlieplex_config_##n = { \
.cells = KSCAN_GPIO_LIST(kscan_charlieplex_cells_##n), \
.debounce_config = \
{ \

View File

@@ -397,7 +397,7 @@ static const struct kscan_driver_api kscan_direct_api = {
.pin_state = kscan_direct_state_##n, \
COND_INTERRUPTS((.irqs = kscan_direct_irqs_##n, ))}; \
\
static struct kscan_direct_config kscan_direct_config_##n = { \
static const struct kscan_direct_config kscan_direct_config_##n = { \
.debounce_config = \
{ \
.debounce_press_ms = INST_DEBOUNCE_PRESS_MS(n), \

View File

@@ -515,7 +515,7 @@ static const struct kscan_driver_api kscan_matrix_api = {
.matrix_state = kscan_matrix_state_##n, \
COND_INTERRUPTS((.irqs = kscan_matrix_irqs_##n, ))}; \
\
static struct kscan_matrix_config kscan_matrix_config_##n = { \
static const struct kscan_matrix_config kscan_matrix_config_##n = { \
.rows = ARRAY_SIZE(kscan_matrix_rows_##n), \
.cols = ARRAY_SIZE(kscan_matrix_cols_##n), \
.outputs = \