Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:struct kobject *kobject_create_and_add(const char *name, struct kobject *parent)

Type:struct kobject

Parameter:

TypeParameterName
const char *name
struct kobject *parent
796  kobj = kobject_create() - Create a struct kobject dynamically.* This function creates a kobject structure dynamically and sets it up* to be a "dynamic" kobject with a default release function set up.
797  If Not kobj Then Return NULL
800  retval = kobject_add() - The main kobject add function.*@kobj: the kobject to add*@parent: pointer to the parent of the kobject.*@fmt: format to name the kobject with.* The kobject name is set and added to the kobject hierarchy in this* function.
801  If retval Then
802  pr_warn("%s: kobject_add error: %d\n", __func__, retval)
803  kobject_put() - Decrement refcount for object.*@kobj: object.* Decrement the refcount, and if 0, call kobject_cleanup().
804  kobj = NULL
806  Return kobj
Caller
NameDescribe
create_setup_data_nodes
boot_params_ksysfs_init
threshold_create_bank
pm_init
klp_init
preemptirq_delay_init
btf_vmlinux_init
hugetlb_sysfs_add_hstate
hugetlb_sysfs_init
hugetlb_register_nodeRegister hstate attributes for a single node device.* No-op if attributes already registered.
register_disk
genhd_device_init
add_partitionMust be called either with bd_mutex held, before a disk can be opened or* after all disk users are gone.