* [PATCH v2 -next] usb: host: use DEFINE_MUTEX() for mutex lock
@ 2020-12-24 13:25 Zheng Yongjun
2020-12-28 14:24 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-24 13:25 UTC (permalink / raw)
To: linux-usb, linux-kernel; +Cc: gregkh, Zheng Yongjun
mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().
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 995bc52d2d22..fb692719a03a 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);
--
2.22.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 -next] usb: host: use DEFINE_MUTEX() for mutex lock
2020-12-24 13:25 [PATCH v2 -next] usb: host: use DEFINE_MUTEX() for mutex lock Zheng Yongjun
@ 2020-12-28 14:24 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2020-12-28 14:24 UTC (permalink / raw)
To: Zheng Yongjun; +Cc: linux-usb, linux-kernel
On Thu, Dec 24, 2020 at 09:25:45PM +0800, Zheng Yongjun wrote:
> mutex lock can be initialized automatically with DEFINE_MUTEX()
> rather than explicitly calling mutex_init().
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
> drivers/usb/host/u132-hcd.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
What changed from v1? Again, please put that below the --- line and
resend a v3.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-28 14:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24 13:25 [PATCH v2 -next] usb: host: use DEFINE_MUTEX() for mutex lock Zheng Yongjun
2020-12-28 14:24 ` Greg KH
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.