forked from kofal.net/zmk
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:
@@ -202,7 +202,7 @@ static int reg_595_init(const struct device *dev) {
|
||||
GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(inst, ngpios))
|
||||
|
||||
#define REG_595_INIT(n) \
|
||||
static struct reg_595_config reg_595_##n##_config = { \
|
||||
static const struct reg_595_config reg_595_##n##_config = { \
|
||||
.common = \
|
||||
{ \
|
||||
.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(n), \
|
||||
|
||||
@@ -322,7 +322,7 @@ static int max7318_init(const struct device *dev) {
|
||||
GPIO_PORT_PIN_MASK_FROM_NGPIOS(DT_INST_PROP(inst, ngpios))
|
||||
|
||||
#define MAX7318_INIT(inst) \
|
||||
static struct max7318_config max7318_##inst##_config = { \
|
||||
static const struct max7318_config max7318_##inst##_config = { \
|
||||
.common = {.port_pin_mask = GPIO_PORT_PIN_MASK_FROM_DT_INST(inst)}, \
|
||||
.i2c_bus = I2C_DT_SPEC_INST_GET(inst)}; \
|
||||
\
|
||||
|
||||
Reference in New Issue
Block a user