OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9c20760
)
usb: host: u132-hcd: use DEFINE_MUTEX() for mutex lock
author
Zheng Yongjun
<zhengyongjun3@huawei.com>
Mon, 5 Apr 2021 10:14:34 +0000
(18:14 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 9 Apr 2021 14:02:30 +0000
(16:02 +0200)
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: Zheng Yongjun <zhengyongjun3@huawei.com>
Link:
https://lore.kernel.org/r/20210405101434.14878-1-zhengyongjun3@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/u132-hcd.c
patch
|
blob
|
history
diff --git
a/drivers/usb/host/u132-hcd.c
b/drivers/usb/host/u132-hcd.c
index
eb96e1e
..
5a783c4
100644
(file)
--- a/
drivers/usb/host/u132-hcd.c
+++ b/
drivers/usb/host/u132-hcd.c
@@
-78,7
+78,7
@@
static DECLARE_WAIT_QUEUE_HEAD(u132_hcd_wait);
* u132_module_lock exists to protect access to global variables
*
*/
-static
struct mutex u132_module_lock
;
+static
DEFINE_MUTEX(u132_module_lock)
;
static int u132_exiting;
static int u132_instances;
/*
@@
-3190,7
+3190,6
@@
static int __init u132_hcd_init(void)
int retval;
u132_instances = 0;
u132_exiting = 0;
- mutex_init(&u132_module_lock);
if (usb_disabled())
return -ENODEV;
printk(KERN_INFO "driver %s\n", hcd_name);