Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test_kmod.c Create Date:2022-07-28 06:34:55
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:alloc_test_dev_kmod

Proto:static struct kmod_test_device *alloc_test_dev_kmod(int idx)

Type:struct kmod_test_device

Parameter:

TypeParameterName
intidx
1086  test_dev = vzalloc(sizeof(structkmod_test_device))
1087  If Not test_dev Then Go to err_out
1090  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & config_mutex)
1091  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & trigger_mutex)
1092  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & thread_mutex)
1094  init_completion( & kthreads_done)
1096  ret = kmod_config_init(test_dev)
1097  If ret < 0 Then
1098  pr_err("Cannot alloc kmod_config_init()\n")
1099  Go to err_out_free
1102  dev_idx = idx
1103  misc_dev = misc_dev
1105  minor = MISC_DYNAMIC_MINOR
1106  name = kasprintf(GFP_KERNEL, "test_kmod%d", idx)
1107  If Not name Then
1108  pr_err("Cannot alloc misc_dev->name\n")
1109  Go to err_out_free_config
1111  groups = test_dev_groups
1113  Return test_dev
1115  err_out_free_config :
1116  free_test_dev_info(test_dev)
1117  kmod_config_free(test_dev)
1118  err_out_free :
1119  vfree(test_dev)
1120  test_dev = NULL
1121  err_out :
1122  Return NULL
Caller
NameDescribe
register_test_dev_kmod