diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2021-03-23 15:51:07 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-23 23:22:09 +0000 |
commit | c8292a044ef11c5e42b0972fdf06344147bc025f (patch) | |
tree | 5ff9322b51488a1ce6106247e42919c73f1f2908 /power | |
parent | ea37a1154cd0882633ab10e0823f51d8c75ddea1 (diff) | |
download | chrome-ec-c8292a044ef11c5e42b0972fdf06344147bc025f.tar.gz |
power: change pwr_5v_ctl_mtx to use K_MUTEX_DEFINE
Use K_MUTEX_DEFINE() to automatically initialize this mutex, removing
the requirement to call k_mutex_init().
BUG=b:177677037
BRANCH=none
TEST=zmake testall && make buildall
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: I2873f5bd46788b24442f0121377abb3132be2622
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2782234
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'power')
-rw-r--r-- | power/common.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/power/common.c b/power/common.c index 34b5cd7b57..df4dce7827 100644 --- a/power/common.c +++ b/power/common.c @@ -1036,7 +1036,7 @@ __overridable void board_power_5v_enable(int enable) /* 5V enable request bitmask from various tasks. */ static uint32_t pwr_5v_en_req; -static mutex_t pwr_5v_ctl_mtx; +K_MUTEX_DEFINE(pwr_5v_ctl_mtx); void power_5v_enable(task_id_t tid, int enable) { @@ -1061,12 +1061,6 @@ static void restore_enable_5v_state(void) const uint32_t *state; int size; - /* - * Initialize the mutex for ZephyrOS. - * This does nothing for non-Zephyr builds. - */ - (void)k_mutex_init(&pwr_5v_ctl_mtx); - state = (const uint32_t *) system_get_jump_tag(P5_SYSJUMP_TAG, 0, &size); if (state && size == sizeof(pwr_5v_en_req)) { |