summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/switchcap_ln9310.c
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-09-07 09:30:22 -0600
committerCommit Bot <commit-bot@chromium.org>2021-09-07 17:32:58 +0000
commitf8cbf77dc5dc10b21d3baa50e7bb3ec3c280380f (patch)
tree1c8289d90d2aedcbd620746d44102acd383404f0 /zephyr/shim/src/switchcap_ln9310.c
parentc96175bef0c7985f55e0fc82c89d79d5b1adf2f5 (diff)
downloadchrome-ec-f8cbf77dc5dc10b21d3baa50e7bb3ec3c280380f.tar.gz
zephyr: Replace DT_ENUM_TOKEN with DT_STRING_TOKEN
In Zephyr v2.7, DT_ENUM_TOKEN is deprecated in favor of DT_STRING_TOKEN. Additionally, DT_ENUM_UPPER_TOKEN is deprecated in favor of DT_STRING_UPPER_TOKEN. See the v2.7 release notes for details: https://docs.zephyrproject.org/latest/releases/release-notes-2.7.html Since we backported the DT_STRING_* macros to our v2.6 branch, let's switch to them ahead of time to prepare for the v2.7 uprev. Note: the DT_STRING_* macros are compatible with Zephyr's device tree enums, but also allow non-enum properties to be used in the same fashion. This commit does the bare minimum for compatibility with v2.7, i.e., just swap the macros without dropping enum properties anywhere. We should investigate whether we want to continue using the enum properties or abandon some of them for any string in the future. BUG=b:198824039 BRANCH=none TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I1efd8f99bc7d93504c0ab94510406cd36ad24cd3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3144536 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/shim/src/switchcap_ln9310.c')
-rw-r--r--zephyr/shim/src/switchcap_ln9310.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/zephyr/shim/src/switchcap_ln9310.c b/zephyr/shim/src/switchcap_ln9310.c
index 997ed8d15f..0647c2d9ae 100644
--- a/zephyr/shim/src/switchcap_ln9310.c
+++ b/zephyr/shim/src/switchcap_ln9310.c
@@ -21,11 +21,9 @@
#define SC_PORT_PHANDLE \
DT_PHANDLE(DT_PATH(switchcap), port)
-#define SC_PORT \
- DT_ENUM_UPPER_TOKEN(SC_PORT_PHANDLE, enum_name)
+#define SC_PORT DT_STRING_UPPER_TOKEN(SC_PORT_PHANDLE, enum_name)
-#define SC_ADDR_FLAGS \
- DT_ENUM_UPPER_TOKEN(DT_PATH(switchcap), addr_flags)
+#define SC_ADDR_FLAGS DT_STRING_UPPER_TOKEN(DT_PATH(switchcap), addr_flags)
void board_set_switchcap_power(int enable)
{