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

@@ -205,8 +205,8 @@ static const struct sensor_driver_api max17048_api_table = {.sample_fetch = max1
.channel_get = max17048_channel_get};
#define MAX17048_INIT(inst) \
static struct max17048_config max17048_##inst##_config = {.i2c_bus = \
I2C_DT_SPEC_INST_GET(inst)}; \
static const struct max17048_config max17048_##inst##_config = { \
.i2c_bus = I2C_DT_SPEC_INST_GET(inst)}; \
\
static struct max17048_drv_data max17048_##inst##_drvdata = { \
.raw_state_of_charge = 0, \