Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: media/siano: kill pointless kmutex definitions

Use the mutex api instead of renaming the calls for this
driver.

Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Davidlohr Bueso and committed by
Mauro Carvalho Chehab
73605de0 b5fe8630

+28 -33
+21 -21
drivers/media/common/siano/smscoreapi.c
··· 429 429 struct smscore_registry_entry_t *entry; 430 430 struct list_head *next; 431 431 432 - kmutex_lock(&g_smscore_registrylock); 432 + mutex_lock(&g_smscore_registrylock); 433 433 for (next = g_smscore_registry.next; 434 434 next != &g_smscore_registry; 435 435 next = next->next) { 436 436 entry = (struct smscore_registry_entry_t *) next; 437 437 if (!strncmp(entry->devpath, devpath, sizeof(entry->devpath))) { 438 - kmutex_unlock(&g_smscore_registrylock); 438 + mutex_unlock(&g_smscore_registrylock); 439 439 return entry; 440 440 } 441 441 } ··· 446 446 list_add(&entry->entry, &g_smscore_registry); 447 447 } else 448 448 pr_err("failed to create smscore_registry.\n"); 449 - kmutex_unlock(&g_smscore_registrylock); 449 + mutex_unlock(&g_smscore_registrylock); 450 450 return entry; 451 451 } 452 452 ··· 527 527 struct list_head *next, *first; 528 528 int rc = 0; 529 529 530 - kmutex_lock(&g_smscore_deviceslock); 530 + mutex_lock(&g_smscore_deviceslock); 531 531 notifyee = kmalloc(sizeof(*notifyee), GFP_KERNEL); 532 532 if (notifyee) { 533 533 /* now notify callback about existing devices */ ··· 548 548 } else 549 549 rc = -ENOMEM; 550 550 551 - kmutex_unlock(&g_smscore_deviceslock); 551 + mutex_unlock(&g_smscore_deviceslock); 552 552 553 553 return rc; 554 554 } ··· 564 564 { 565 565 struct list_head *next, *first; 566 566 567 - kmutex_lock(&g_smscore_deviceslock); 567 + mutex_lock(&g_smscore_deviceslock); 568 568 569 569 first = &g_smscore_notifyees; 570 570 ··· 579 579 } 580 580 } 581 581 582 - kmutex_unlock(&g_smscore_deviceslock); 582 + mutex_unlock(&g_smscore_deviceslock); 583 583 } 584 584 EXPORT_SYMBOL_GPL(smscore_unregister_hotplug); 585 585 ··· 732 732 smscore_registry_settype(dev->devpath, params->device_type); 733 733 734 734 /* add device to devices list */ 735 - kmutex_lock(&g_smscore_deviceslock); 735 + mutex_lock(&g_smscore_deviceslock); 736 736 list_add(&dev->entry, &g_smscore_devices); 737 - kmutex_unlock(&g_smscore_deviceslock); 737 + mutex_unlock(&g_smscore_deviceslock); 738 738 739 739 *coredev = dev; 740 740 ··· 890 890 return rc; 891 891 } 892 892 893 - kmutex_lock(&g_smscore_deviceslock); 893 + mutex_lock(&g_smscore_deviceslock); 894 894 895 895 rc = smscore_notify_callbacks(coredev, coredev->device, 1); 896 896 smscore_init_ir(coredev); 897 897 898 898 pr_debug("device %p started, rc %d\n", coredev, rc); 899 899 900 - kmutex_unlock(&g_smscore_deviceslock); 900 + mutex_unlock(&g_smscore_deviceslock); 901 901 902 902 return rc; 903 903 } ··· 1197 1197 int num_buffers = 0; 1198 1198 int retry = 0; 1199 1199 1200 - kmutex_lock(&g_smscore_deviceslock); 1200 + mutex_lock(&g_smscore_deviceslock); 1201 1201 1202 1202 /* Release input device (IR) resources */ 1203 1203 sms_ir_exit(coredev); ··· 1224 1224 1225 1225 pr_debug("waiting for %d buffer(s)\n", 1226 1226 coredev->num_buffers - num_buffers); 1227 - kmutex_unlock(&g_smscore_deviceslock); 1227 + mutex_unlock(&g_smscore_deviceslock); 1228 1228 msleep(100); 1229 - kmutex_lock(&g_smscore_deviceslock); 1229 + mutex_lock(&g_smscore_deviceslock); 1230 1230 } 1231 1231 1232 1232 pr_debug("freed %d buffers\n", num_buffers); ··· 1245 1245 list_del(&coredev->entry); 1246 1246 kfree(coredev); 1247 1247 1248 - kmutex_unlock(&g_smscore_deviceslock); 1248 + mutex_unlock(&g_smscore_deviceslock); 1249 1249 1250 1250 pr_debug("device %p destroyed\n", coredev); 1251 1251 } ··· 2123 2123 { 2124 2124 INIT_LIST_HEAD(&g_smscore_notifyees); 2125 2125 INIT_LIST_HEAD(&g_smscore_devices); 2126 - kmutex_init(&g_smscore_deviceslock); 2126 + mutex_init(&g_smscore_deviceslock); 2127 2127 2128 2128 INIT_LIST_HEAD(&g_smscore_registry); 2129 - kmutex_init(&g_smscore_registrylock); 2129 + mutex_init(&g_smscore_registrylock); 2130 2130 2131 2131 return 0; 2132 2132 } 2133 2133 2134 2134 static void __exit smscore_module_exit(void) 2135 2135 { 2136 - kmutex_lock(&g_smscore_deviceslock); 2136 + mutex_lock(&g_smscore_deviceslock); 2137 2137 while (!list_empty(&g_smscore_notifyees)) { 2138 2138 struct smscore_device_notifyee_t *notifyee = 2139 2139 (struct smscore_device_notifyee_t *) ··· 2142 2142 list_del(&notifyee->entry); 2143 2143 kfree(notifyee); 2144 2144 } 2145 - kmutex_unlock(&g_smscore_deviceslock); 2145 + mutex_unlock(&g_smscore_deviceslock); 2146 2146 2147 - kmutex_lock(&g_smscore_registrylock); 2147 + mutex_lock(&g_smscore_registrylock); 2148 2148 while (!list_empty(&g_smscore_registry)) { 2149 2149 struct smscore_registry_entry_t *entry = 2150 2150 (struct smscore_registry_entry_t *) ··· 2153 2153 list_del(&entry->entry); 2154 2154 kfree(entry); 2155 2155 } 2156 - kmutex_unlock(&g_smscore_registrylock); 2156 + mutex_unlock(&g_smscore_registrylock); 2157 2157 2158 2158 pr_debug("\n"); 2159 2159 }
-5
drivers/media/common/siano/smscoreapi.h
··· 28 28 29 29 #include "smsir.h" 30 30 31 - #define kmutex_init(_p_) mutex_init(_p_) 32 - #define kmutex_lock(_p_) mutex_lock(_p_) 33 - #define kmutex_trylock(_p_) mutex_trylock(_p_) 34 - #define kmutex_unlock(_p_) mutex_unlock(_p_) 35 - 36 31 /* 37 32 * Define the firmware names used by the driver. 38 33 * Those should match what's used at smscoreapi.c and sms-cards.c
+7 -7
drivers/media/common/siano/smsdvb-main.c
··· 630 630 631 631 static void smsdvb_onremove(void *context) 632 632 { 633 - kmutex_lock(&g_smsdvb_clientslock); 633 + mutex_lock(&g_smsdvb_clientslock); 634 634 635 635 smsdvb_unregister_client((struct smsdvb_client_t *) context); 636 636 637 - kmutex_unlock(&g_smsdvb_clientslock); 637 + mutex_unlock(&g_smsdvb_clientslock); 638 638 } 639 639 640 640 static int smsdvb_start_feed(struct dvb_demux_feed *feed) ··· 1151 1151 init_completion(&client->tune_done); 1152 1152 init_completion(&client->stats_done); 1153 1153 1154 - kmutex_lock(&g_smsdvb_clientslock); 1154 + mutex_lock(&g_smsdvb_clientslock); 1155 1155 1156 1156 list_add(&client->entry, &g_smsdvb_clients); 1157 1157 1158 - kmutex_unlock(&g_smsdvb_clientslock); 1158 + mutex_unlock(&g_smsdvb_clientslock); 1159 1159 1160 1160 client->event_fe_state = -1; 1161 1161 client->event_unc_state = -1; ··· 1201 1201 int rc; 1202 1202 1203 1203 INIT_LIST_HEAD(&g_smsdvb_clients); 1204 - kmutex_init(&g_smsdvb_clientslock); 1204 + mutex_init(&g_smsdvb_clientslock); 1205 1205 1206 1206 smsdvb_debugfs_register(); 1207 1207 ··· 1216 1216 { 1217 1217 smscore_unregister_hotplug(smsdvb_hotplug); 1218 1218 1219 - kmutex_lock(&g_smsdvb_clientslock); 1219 + mutex_lock(&g_smsdvb_clientslock); 1220 1220 1221 1221 while (!list_empty(&g_smsdvb_clients)) 1222 1222 smsdvb_unregister_client((struct smsdvb_client_t *)g_smsdvb_clients.next); 1223 1223 1224 1224 smsdvb_debugfs_unregister(); 1225 1225 1226 - kmutex_unlock(&g_smsdvb_clientslock); 1226 + mutex_unlock(&g_smsdvb_clientslock); 1227 1227 } 1228 1228 1229 1229 module_init(smsdvb_module_init);