Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
d453379b
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d453379b
编写于
12月 28, 2008
作者:
T
Takashi Iwai
提交者:
Takashi Iwai
1月 12, 2009
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ALSA: Update description of snd_card_create() in documents
Signed-off-by:
N
Takashi Iwai
<
tiwai@suse.de
>
上级
bd7dd77c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
19 deletion
+25
-19
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+25
-19
未找到文件。
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
浏览文件 @
d453379b
...
...
@@ -492,9 +492,9 @@
}
/* (2) */
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0
);
if (
card == NULL
)
return
-ENOMEM
;
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0,
&card
);
if (
err
<
0
)
return
err
;
/* (3) */
err = snd_mychip_create(card, pci,
&chip);
...
...
@@ -590,8 +590,9 @@
<programlisting>
<![CDATA[
struct snd_card *card;
int err;
....
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0
);
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card
);
]]>
</programlisting>
</informalexample>
...
...
@@ -809,26 +810,28 @@
<para>
As mentioned above, to create a card instance, call
<function>
snd_card_
new
()
</function>
.
<function>
snd_card_
create
()
</function>
.
<informalexample>
<programlisting>
<![CDATA[
struct snd_card *card;
card = snd_card_new(index, id, module, extra_size);
int err;
err = snd_card_create(index, id, module, extra_size, &card);
]]>
</programlisting>
</informalexample>
</para>
<para>
The function takes f
our
arguments, the card-index number, the
The function takes f
ive
arguments, the card-index number, the
id string, the module pointer (usually
<constant>
THIS_MODULE
</constant>
),
and the size of extra-data space. The last argument is used to
the size of extra-data space, and the pointer to return the
card instance. The extra_size argument is used to
allocate card-
>
private_data for the
chip-specific data. Note that these data
are allocated by
<function>
snd_card_
new
()
</function>
.
are allocated by
<function>
snd_card_
create
()
</function>
.
</para>
</section>
...
...
@@ -915,15 +918,16 @@
</para>
<section
id=
"card-management-chip-specific-snd-card-new"
>
<title>
1. Allocating via
<function>
snd_card_
new
()
</function>
.
</title>
<title>
1. Allocating via
<function>
snd_card_
create
()
</function>
.
</title>
<para>
As mentioned above, you can pass the extra-data-length
to the 4th argument of
<function>
snd_card_
new
()
</function>
, i.e.
to the 4th argument of
<function>
snd_card_
create
()
</function>
, i.e.
<informalexample>
<programlisting>
<![CDATA[
card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(struct mychip));
err = snd_card_create(index[dev], id[dev], THIS_MODULE,
sizeof(struct mychip), &card);
]]>
</programlisting>
</informalexample>
...
...
@@ -952,8 +956,8 @@
<para>
After allocating a card instance via
<function>
snd_card_
new
()
</function>
(with
<constant>
NULL
</constant>
on the 4th arg), call
<function>
snd_card_
create
()
</function>
(with
<constant>
0
</constant>
on the 4th arg), call
<function>
kzalloc()
</function>
.
<informalexample>
...
...
@@ -961,7 +965,7 @@
<![CDATA[
struct snd_card *card;
struct mychip *chip;
card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL
);
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card
);
.....
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
]]>
...
...
@@ -5750,8 +5754,9 @@ struct _snd_pcm_runtime {
....
struct snd_card *card;
struct mychip *chip;
int err;
....
card = snd_card_new(index[dev], id[dev], THIS_MODULE, NULL
);
err = snd_card_create(index[dev], id[dev], THIS_MODULE, 0, &card
);
....
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
....
...
...
@@ -5763,7 +5768,7 @@ struct _snd_pcm_runtime {
</informalexample>
When you created the chip data with
<function>
snd_card_
new
()
</function>
, it's anyway accessible
<function>
snd_card_
create
()
</function>
, it's anyway accessible
via
<structfield>
private_data
</structfield>
field.
<informalexample>
...
...
@@ -5775,9 +5780,10 @@ struct _snd_pcm_runtime {
....
struct snd_card *card;
struct mychip *chip;
int err;
....
card = snd_card_new
(index[dev], id[dev], THIS_MODULE,
sizeof(struct mychip)
);
err = snd_card_create
(index[dev], id[dev], THIS_MODULE,
sizeof(struct mychip), &card
);
....
chip = card->
private_data;
....
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录