linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] usb: host: u132-hcd: use DEFINE_MUTEX() for mutex lock
@ 2021-04-05 10:14 Zheng Yongjun
  0 siblings, 0 replies; only message in thread
From: Zheng Yongjun @ 2021-04-05 10:14 UTC (permalink / raw)
  To: zhengyongjun3, Greg Kroah-Hartman, Madhuparna Bhowmik, Tom Rix
  Cc: linux-usb, kernel-janitors, Hulk Robot

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>
---
 drivers/usb/host/u132-hcd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index eb96e1e15b71..5a783c423d8e 100644
--- 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);


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-05 10:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05 10:14 [PATCH -next] usb: host: u132-hcd: use DEFINE_MUTEX() for mutex lock Zheng Yongjun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).