Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\ksysfs.c Create Date:2022-07-28 07:42:44
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:create_setup_data_nodes

Proto:static int __init create_setup_data_nodes(struct kobject *parent)

Type:int

Parameter:

TypeParameterName
struct kobject *parent
286  ret = 0
288  pa_data = setup_data
289  If Not pa_data Then Return 0
292  setup_data_kobj = kobject_create_and_add() - Create a struct kobject dynamically and* register it with sysfs.*@name: the name for the kobject*@parent: the parent kobject of this kobject, if any.* This function creates a kobject structure dynamically and registers it
293  If Not setup_data_kobj Then
294  ret = -ENOMEM
295  Go to out
298  ret = get_setup_data_total_num(pa_data, & nr)
299  If ret Then Go to out_setup_data_kobj
302  kobjp = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
303  If Not kobjp Then
304  ret = -ENOMEM
305  Go to out_setup_data_kobj
308  When i < nr cycle
309  ret = create_setup_data_node(setup_data_kobj, kobjp + i, i)
310  If ret Then Go to out_clean_nodes
314  free previously allocated memory
315  Return 0
317  out_clean_nodes :
318  When j >= 0 cycle cleanup_setup_data_node( * (kobjp + j))
320  free previously allocated memory
321  out_setup_data_kobj :
322  kobject_put() - Decrement refcount for object.*@kobj: object.* Decrement the refcount, and if 0, call kobject_cleanup().
323  out :
324  Return ret
Caller
NameDescribe
boot_params_ksysfs_init