media: siano: use DEFINE_MUTEX() for mutex lock
authorMuhammad Usama Anjum <musamaanjum@gmail.com>
Mon, 5 Apr 2021 20:52:19 +0000 (22:52 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 30 Sep 2021 08:07:43 +0000 (10:07 +0200)
mutex lock can be initialized with DEFINE_MUTEX() rather than
explicitly calling mutex_init().

Signed-off-by: Muhammad Usama Anjum <musamaanjum@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/common/siano/smscoreapi.c

index bceaf91faa15f7c80fecf93aaf2c4cab5a2e4033..7d4bc2733f2b074e0d2cba7157ee297bc4110a55 100644 (file)
@@ -414,10 +414,10 @@ struct smscore_registry_entry_t {
 
 static struct list_head g_smscore_notifyees;
 static struct list_head g_smscore_devices;
-static struct mutex g_smscore_deviceslock;
+static DEFINE_MUTEX(g_smscore_deviceslock);
 
 static struct list_head g_smscore_registry;
-static struct mutex g_smscore_registrylock;
+static DEFINE_MUTEX(g_smscore_registrylock);
 
 static int default_mode = DEVICE_MODE_NONE;
 
@@ -2119,10 +2119,7 @@ static int __init smscore_module_init(void)
 {
        INIT_LIST_HEAD(&g_smscore_notifyees);
        INIT_LIST_HEAD(&g_smscore_devices);
-       mutex_init(&g_smscore_deviceslock);
-
        INIT_LIST_HEAD(&g_smscore_registry);
-       mutex_init(&g_smscore_registrylock);
 
        return 0;
 }