summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Barnaś <mb@semihalf.com>2021-09-22 18:19:29 +0200
committerCommit Bot <commit-bot@chromium.org>2021-09-22 20:41:57 +0000
commitba61af3b8c8a1f04caba91c4a264c78c1fe7d77b (patch)
tree500cf6c606279ec8c9ade329f438917fa382e610
parentad544d622f397f9b2e1adddb5001fbfc78086fa8 (diff)
downloadchrome-ec-ba61af3b8c8a1f04caba91c4a264c78c1fe7d77b.tar.gz
zephyr: fix support for multiple fans
This commit fixes macros used to create named-fans instances. It will enable to have multiple named-fans declared in devicetree without raising "multiple definitions" error during compilation. BRANCH=main BUG=none TEST=Add named-fans instance in device tree and build firmware. Compilation with 2 or more names-fans should work correctly. Change-Id: If5c9a74f743749efc3a2872b0ced98500e96ca52 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3176200 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/shim/src/fan.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/zephyr/shim/src/fan.c b/zephyr/shim/src/fan.c
index b6fa7b999a..932688fc9c 100644
--- a/zephyr/shim/src/fan.c
+++ b/zephyr/shim/src/fan.c
@@ -18,7 +18,7 @@
LOG_MODULE_REGISTER(fan_shim, LOG_LEVEL_ERR);
#define FAN_CONFIGS(node_id) \
- const struct fan_conf node_id_conf = { \
+ const struct fan_conf node_id##_conf = { \
.flags = (COND_CODE_1(DT_PROP(node_id, not_use_rpm_mode), \
(0), (FAN_USE_RPM_MODE))) | \
(COND_CODE_1(DT_PROP(node_id, use_fast_start), \
@@ -33,7 +33,7 @@ LOG_MODULE_REGISTER(fan_shim, LOG_LEVEL_ERR);
(GPIO_SIGNAL(DT_PHANDLE(node_id, enable_gpio))), \
(GPIO_UNIMPLEMENTED)), \
}; \
- const struct fan_rpm node_id_rpm = { \
+ const struct fan_rpm node_id##_rpm = { \
.rpm_min = DT_PROP(node_id, rpm_min), \
.rpm_start = DT_PROP(node_id, rpm_start), \
.rpm_max = DT_PROP(node_id, rpm_max), \
@@ -41,8 +41,8 @@ LOG_MODULE_REGISTER(fan_shim, LOG_LEVEL_ERR);
#define FAN_INST(node_id) \
[node_id] = { \
- .conf = &node_id_conf, \
- .rpm = &node_id_rpm, \
+ .conf = &node_id##_conf, \
+ .rpm = &node_id##_rpm, \
},
#define FAN_CONTROL_INST(node_id) \