drivers: i2c: tca9544a #155536
Annotations
1 error, 1 warning, and 1 notice
Run Compliance Tests
Process completed with exit code 1.
|
check-warns:
ClangFormat.txt#L1
See https://docs.zephyrproject.org/latest/contribute/guidelines.html#clang-format for more details.
You may want to run clang-format on this change:
-#define TCA954x_CHILD_DEFINE(node_id, n, has_enable_bit) \
- static const struct tca954x_channel_config \
- tca##n##a_down_config_##node_id = { \
+#define TCA954x_CHILD_DEFINE(node_id, n, has_enable_bit) \
+ static const struct tca954x_channel_config tca##n##a_down_config_##node_id = { \
.chan_mask = has_enable_bit ? BIT(2) | DT_REG_ADDR(node_id) \
: BIT(DT_REG_ADDR(node_id)), \
- .root = DEVICE_DT_GET(DT_PARENT(node_id)), \
+ .root = DEVICE_DT_GET(DT_PARENT(node_id)), \
.has_enable = has_enable_bit, \
- }; \
- DEVICE_DT_DEFINE(node_id, \
- tca954x_channel_init, \
- NULL, \
- NULL, \
- &tca##n##a_down_config_##node_id, \
- POST_KERNEL, CONFIG_I2C_TCA954X_CHANNEL_INIT_PRIO, \
- &tca954x_api_funcs);
-
-#define TCA954x_ROOT_DEFINE(n, inst, ch, has_enable_bit) \
- static const struct tca954x_root_config tca##n##a_cfg_##inst = { \
- .i2c = I2C_DT_SPEC_INST_GET(inst), \
- .nchans = ch, \
- .reset_gpios = GPIO_DT_SPEC_GET_OR( \
- DT_INST(inst, ti_tca##n##a), reset_gpios, {0}), \
- }; \
- static struct tca954x_root_data tca##n##a_data_##inst = { \
- .lock = Z_MUTEX_INITIALIZER(tca##n##a_data_##inst.lock), \
- }; \
- I2C_DEVICE_DT_DEFINE(DT_INST(inst, ti_tca##n##a), \
- tca954x_root_init, NULL, \
- &tca##n##a_data_##inst, &tca##n##a_cfg_##inst, \
- POST_KERNEL, CONFIG_I2C_TCA954X_ROOT_INIT_PRIO, \
- NULL); \
+ }; \
+ DEVICE_DT_DEFINE(node_id, tca954x_channel_init, NULL, NULL, \
+ &tca##n##a_down_config_##node_id, POST_KERNEL, \
+ CONFIG_I2C_TCA954X_CHANNEL_INIT_PRIO, &tca954x_api_funcs);
+
+#define TCA954x_ROOT_DEFINE(n, inst, ch, has_enable_bit) \
+ static const struct tca954x_root_config tca##n##a_cfg_##inst = { \
+ .i2c = I2C_DT_SPEC_INST_GET(inst), \
+ .nchans = ch, \
+ .reset_gpios = GPIO_DT_SPEC_GET_OR(DT_INST(inst, ti_tca##n##a), reset_gpios, {0}), \
+ }; \
+ static struct tca954x_root_data tca##n##a_data_##inst = { \
+ .lock = Z_MUTEX_INITIALIZER(tca##n##a_data_##inst.lock), \
+ }; \
+ I2C_DEVICE_DT_DEFINE(DT_INST(inst, ti_tca##n##a), tca954x_root_init, NULL, \
+ &tca##n##a_data_##inst, &tca##n##a_cfg_##inst, POST_KERNEL, \
+ CONFIG_I2C_TCA954X_ROOT_INIT_PRIO, NULL); \
DT_FOREACH_CHILD_VARGS(DT_INST(inst, ti_tca##n##a), TCA954x_CHILD_DEFINE, n, \
- has_enable_bit);
+ has_enable_bit);
File:drivers/i2c/i2c_tca954x.c
Line:200
|
Run Compliance Tests:
drivers/i2c/i2c_tca954x.c#L200
drivers/i2c/i2c_tca954x.c:200
-#define TCA954x_CHILD_DEFINE(node_id, n, has_enable_bit) \
- static const struct tca954x_channel_config \
- tca##n##a_down_config_##node_id = { \
+#define TCA954x_CHILD_DEFINE(node_id, n, has_enable_bit) \
+ static const struct tca954x_channel_config tca##n##a_down_config_##node_id = { \
.chan_mask = has_enable_bit ? BIT(2) | DT_REG_ADDR(node_id) \
: BIT(DT_REG_ADDR(node_id)), \
- .root = DEVICE_DT_GET(DT_PARENT(node_id)), \
+ .root = DEVICE_DT_GET(DT_PARENT(node_id)), \
.has_enable = has_enable_bit, \
- }; \
- DEVICE_DT_DEFINE(node_id, \
- tca954x_channel_init, \
- NULL, \
- NULL, \
- &tca##n##a_down_config_##node_id, \
- POST_KERNEL, CONFIG_I2C_TCA954X_CHANNEL_INIT_PRIO, \
- &tca954x_api_funcs);
-
-#define TCA954x_ROOT_DEFINE(n, inst, ch, has_enable_bit) \
- static const struct tca954x_root_config tca##n##a_cfg_##inst = { \
- .i2c = I2C_DT_SPEC_INST_GET(inst), \
- .nchans = ch, \
- .reset_gpios = GPIO_DT_SPEC_GET_OR( \
- DT_INST(inst, ti_tca##n##a), reset_gpios, {0}), \
- }; \
- static struct tca954x_root_data tca##n##a_data_##inst = { \
- .lock = Z_MUTEX_INITIALIZER(tca##n##a_data_##inst.lock), \
- }; \
- I2C_DEVICE_DT_DEFINE(DT_INST(inst, ti_tca##n##a), \
- tca954x_root_init, NULL, \
- &tca##n##a_data_##inst, &tca##n##a_cfg_##inst, \
- POST_KERNEL, CONFIG_I2C_TCA954X_ROOT_INIT_PRIO, \
- NULL); \
+ }; \
+ DEVICE_DT_DEFINE(node_id, tca954x_channel_init, NULL, NULL, \
+ &tca##n##a_down_config_##node_id, POST_KERNEL, \
+ CONFIG_I2C_TCA954X_CHANNEL_INIT_PRIO, &tca954x_api_funcs);
+
+#define TCA954x_ROOT_DEFINE(n, inst, ch, has_enable_bit) \
+ static const struct tca954x_root_config tca##n##a_cfg_##inst = { \
+ .i2c = I2C_DT_SPEC_INST_GET(inst), \
+ .nchans = ch, \
+ .reset_gpios = GPIO_DT_SPEC_GET_OR(DT_INST(inst, ti_tca##n##a), reset_gpios, {0}), \
+ }; \
+ static struct tca954x_root_data tca##n##a_data_##inst = { \
+ .lock = Z_MUTEX_INITIALIZER(tca##n##a_data_##inst.lock), \
+ }; \
+ I2C_DEVICE_DT_DEFINE(DT_INST(inst, ti_tca##n##a), tca954x_root_init, NULL, \
+ &tca##n##a_data_##inst, &tca##n##a_cfg_##inst, POST_KERNEL, \
+ CONFIG_I2C_TCA954X_ROOT_INIT_PRIO, NULL); \
DT_FOREACH_CHILD_VARGS(DT_INST(inst, ti_tca##n##a), TCA954x_CHILD_DEFINE, n, \
- has_enable_bit);
+ has_enable_bit);
|
Loading