Skip to content

Commit d61b3f9

Browse files
Ye BinEnric Balletbo i Serra
authored andcommitted
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 <[email protected]> Signed-off-by: Ye Bin <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 4423ee6 commit d61b3f9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/platform/chrome/cros_ec_lpc_mec.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* This mutex must be held while accessing the EMI unit. We can't rely on the
1515
* EC mutex because memmap data may be accessed without it being held.
1616
*/
17-
static struct mutex io_mutex;
17+
static DEFINE_MUTEX(io_mutex);
1818
static u16 mec_emi_base, mec_emi_end;
1919

2020
/**
@@ -142,7 +142,6 @@ EXPORT_SYMBOL(cros_ec_lpc_io_bytes_mec);
142142

143143
void cros_ec_lpc_mec_init(unsigned int base, unsigned int end)
144144
{
145-
mutex_init(&io_mutex);
146145
mec_emi_base = base;
147146
mec_emi_end = end;
148147
}

0 commit comments

Comments
 (0)