summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-03-23 15:59:33 -0600
committerCommit Bot <commit-bot@chromium.org>2021-03-23 23:22:30 +0000
commit2798c6ef62c6b1c07d024f98caec71d4662b091c (patch)
treee2dfd767a0ec84be67c66130afa6340d555f6f97 /driver
parent1d8d66457d9bdb6ada92e4bfd88d7d15ba4919da (diff)
downloadchrome-ec-2798c6ef62c6b1c07d024f98caec71d4662b091c.tar.gz
isl923x: change control1_mutex to use K_MUTEX_DEFINE
Convert control1_mutex to use K_MUTEX_DEFINE(), removing the requirement for runtime initialization on Zephyr. BUG=b:177677037 BRANCH=none TEST=zmake testall && make buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I4aa0cba73e4283d6050ddbe46bda542788bcab0f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2782238 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r--driver/charger/isl923x.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/driver/charger/isl923x.c b/driver/charger/isl923x.c
index 2f822d64e1..129fe30000 100644
--- a/driver/charger/isl923x.c
+++ b/driver/charger/isl923x.c
@@ -95,7 +95,7 @@ enum isl923x_mon_dir { MON_CHARGE = 0, MON_DISCHARGE = 1 };
static int learn_mode;
/* Mutex for CONTROL1 register, that can be updated from multiple tasks. */
-static mutex_t control1_mutex;
+K_MUTEX_DEFINE(control1_mutex);
static enum ec_error_list isl923x_discharge_on_ac(int chgnum, int enable);
@@ -559,7 +559,6 @@ static void isl923x_init(int chgnum)
int precharge_voltage = bi->precharge_voltage ?
bi->precharge_voltage : bi->voltage_min;
- (void)k_mutex_init(&control1_mutex);
if (IS_ENABLED(CONFIG_CHARGER_RAA489000)) {
if (CONFIG_CHARGER_SENSE_RESISTOR ==
CONFIG_CHARGER_SENSE_RESISTOR_AC) {