函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\kobject.c Create Date:2022-07-27 07:13:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:kobject_add_internal

函数原型:static int kobject_add_internal(struct kobject *kobj)

返回类型:int

参数:

类型参数名称
struct kobject *kobj
227  error等于0
230  如果非kobj则返回:负ENOENT
233  如果非设备对象名称或非设备对象名称[0]则
234  WARN(1, "kobject: (%p): attempted to be registered with empty name!\n", kobj)
237  返回:负EINVAL
240  parent等于增加引用计数对象
243  如果设备组指针
244  如果非parentparent等于增加引用计数对象
246  add the kobject to its kset's list
247  父设备指针等于parent
250  pr_debug("kobject: '%s' (%p): %s: parent: '%s', set: '%s'\n", kobject_name(kobj), kobj, __func__, parent ? kobject_name(parent) : "<NULL>", 设备组指针 ? kobject_name( & 设备对象) : "<NULL>")
255  error等于create_dir(kobj)
256  如果error
257  move the kobject from its kset's list
258  递减引用计数对象
259  父设备指针 = NULL
262  如果error恒等于负EEXIST打印错误信息("%s failed for %s with -EEXIST, don't try to register things with the same name in the same directory.\n", __func__, kobject_name(kobj))
265  否则打印错误信息("%s failed for %s (error: %d parent: %s)\n", __func__, kobject_name(kobj), error, parent ? kobject_name(parent) : "'none'")
269  否则state_in_sysfs等于1
272  返回:error
调用者
名称描述
kobject_add_varg
kset_register初始化并注册kset