summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Bin <yebin10@huawei.com>2021-04-09 17:51:38 +0800
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>2021-04-21 10:00:30 +0200
commitd61b3f9b91be32f714b218377ab5081932e3ebc2 (patch)
tree2dccb454f3a62b1603ca6528e409289b93c209d1
parent4423ee65f76818c8a8994e6f5821372661ea7f89 (diff)
platform/chrome: cros_ec_lpc: Use DEFINE_MUTEX() for mutex lock
mutex lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init(). Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Ye Bin <yebin10@huawei.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Link: https://lore.kernel.org/r/20210409095138.2293869-1-yebin10@huawei.com
-rw-r--r--drivers/platform/chrome/cros_ec_lpc_mec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/platform/chrome/cros_ec_lpc_mec.c b/drivers/platform/chrome/cros_ec_lpc_mec.c
index 9035b17e8c86..bbc2884f5e2f 100644
--- a/drivers/platform/chrome/cros_ec_lpc_mec.c
+++ b/drivers/platform/chrome/cros_ec_lpc_mec.c
@@ -14,7 +14,7 @@
* This mutex must be held while accessing the EMI unit. We can't rely on the
* EC mutex because memmap data may be accessed without it being held.
*/
-static struct mutex io_mutex;
+static DEFINE_MUTEX(io_mutex);
static u16 mec_emi_base, mec_emi_end;
/**
@@ -142,7 +142,6 @@ EXPORT_SYMBOL(cros_ec_lpc_io_bytes_mec);
void cros_ec_lpc_mec_init(unsigned int base, unsigned int end)
{
- mutex_init(&io_mutex);
mec_emi_base = base;
mec_emi_end = end;
}