Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
2fc68447
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2fc68447
编写于
3月 23, 2005
作者:
G
gregkh@suse.de
提交者:
Greg Kroah-Hartman
6月 20, 2005
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] class: add kerneldoc for the new class functions.
Signed-off-by:
N
Greg Kroah-Hartman
<
gregkh@suse.de
>
上级
1db560af
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
43 addition
and
0 deletion
+43
-0
drivers/base/class.c
drivers/base/class.c
+43
-0
未找到文件。
drivers/base/class.c
浏览文件 @
2fc68447
...
...
@@ -173,6 +173,17 @@ static void class_device_create_release(struct class_device *class_dev)
kfree
(
class_dev
);
}
/**
* class_create - create a struct class structure
* @owner: pointer to the module that is to "own" this struct class
* @name: pointer to a string for the name of this class.
*
* This is used to create a struct class pointer that can then be used
* in calls to class_device_create().
*
* Note, the pointer created here is to be destroyed when finished by
* making a call to class_destroy().
*/
struct
class
*
class_create
(
struct
module
*
owner
,
char
*
name
)
{
struct
class
*
cls
;
...
...
@@ -201,6 +212,13 @@ struct class *class_create(struct module *owner, char *name)
return
ERR_PTR
(
retval
);
}
/**
* class_destroy - destroys a struct class structure
* @cs: pointer to the struct class that is to be destroyed
*
* Note, the pointer to be destroyed must have been created with a call
* to class_create().
*/
void
class_destroy
(
struct
class
*
cls
)
{
if
((
cls
==
NULL
)
||
(
IS_ERR
(
cls
)))
...
...
@@ -505,6 +523,23 @@ int class_device_register(struct class_device *class_dev)
return
class_device_add
(
class_dev
);
}
/**
* class_device_create - creates a class device and registers it with sysfs
* @cs: pointer to the struct class that this device should be registered to.
* @dev: the dev_t for the char device to be added.
* @device: a pointer to a struct device that is assiociated with this class device.
* @fmt: string for the class device's name
*
* This function can be used by char device classes. A struct
* class_device will be created in sysfs, registered to the specified
* class. A "dev" file will be created, showing the dev_t for the
* device. The pointer to the struct class_device will be returned from
* the call. Any further sysfs files that might be required can be
* created using this pointer.
*
* Note: the struct class passed to this function must have previously
* been created with a call to class_create().
*/
struct
class_device
*
class_device_create
(
struct
class
*
cls
,
dev_t
devt
,
struct
device
*
device
,
char
*
fmt
,
...)
{
...
...
@@ -578,6 +613,14 @@ void class_device_unregister(struct class_device *class_dev)
class_device_put
(
class_dev
);
}
/**
* class_device_destroy - removes a class device that was created with class_device_create()
* @cls: the pointer to the struct class that this device was registered * with.
* @dev: the dev_t of the device that was previously registered.
*
* This call unregisters and cleans up a class device that was created with a
* call to class_device_create()
*/
void
class_device_destroy
(
struct
class
*
cls
,
dev_t
devt
)
{
struct
class_device
*
class_dev
=
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录