Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
ad3ae47b
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ad3ae47b
编写于
6月 26, 2013
作者:
M
Mark Brown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ASoC: nuc900-ac97: Convert to use devm_ APIs
Signed-off-by:
N
Mark Brown
<
broonie@linaro.org
>
上级
417ced8b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
36 deletion
+13
-36
sound/soc/nuc900/nuc900-ac97.c
sound/soc/nuc900/nuc900-ac97.c
+13
-36
未找到文件。
sound/soc/nuc900/nuc900-ac97.c
浏览文件 @
ad3ae47b
...
...
@@ -326,41 +326,32 @@ static int nuc900_ac97_drvprobe(struct platform_device *pdev)
if
(
nuc900_ac97_data
)
return
-
EBUSY
;
nuc900_audio
=
kzalloc
(
sizeof
(
struct
nuc900_audio
),
GFP_KERNEL
);
nuc900_audio
=
devm_kzalloc
(
&
pdev
->
dev
,
sizeof
(
struct
nuc900_audio
),
GFP_KERNEL
);
if
(
!
nuc900_audio
)
return
-
ENOMEM
;
spin_lock_init
(
&
nuc900_audio
->
lock
);
nuc900_audio
->
res
=
platform_get_resource
(
pdev
,
IORESOURCE_MEM
,
0
);
if
(
!
nuc900_audio
->
res
)
{
ret
=
-
ENODEV
;
goto
out0
;
}
if
(
!
nuc900_audio
->
res
)
return
ret
;
if
(
!
request_mem_region
(
nuc900_audio
->
res
->
start
,
resource_size
(
nuc900_audio
->
res
),
pdev
->
name
))
{
ret
=
-
EBUSY
;
goto
out0
;
}
nuc900_audio
->
mmio
=
ioremap
(
nuc900_audio
->
res
->
start
,
resource_size
(
nuc900_audio
->
res
));
if
(
!
nuc900_audio
->
mmio
)
{
ret
=
-
ENOMEM
;
goto
out1
;
}
nuc900_audio
->
mmio
=
devm_ioremap_resource
(
&
pdev
->
dev
,
nuc900_audio
->
res
);
if
(
IS_ERR
(
nuc900_audio
->
mmio
))
return
PTR_ERR
(
nuc900_audio
->
mmio
);
nuc900_audio
->
clk
=
clk_get
(
&
pdev
->
dev
,
NULL
);
nuc900_audio
->
clk
=
devm_
clk_get
(
&
pdev
->
dev
,
NULL
);
if
(
IS_ERR
(
nuc900_audio
->
clk
))
{
ret
=
PTR_ERR
(
nuc900_audio
->
clk
);
goto
out
2
;
goto
out
;
}
nuc900_audio
->
irq_num
=
platform_get_irq
(
pdev
,
0
);
if
(
!
nuc900_audio
->
irq_num
)
{
ret
=
-
EBUSY
;
goto
out
3
;
goto
out
;
}
nuc900_ac97_data
=
nuc900_audio
;
...
...
@@ -368,22 +359,14 @@ static int nuc900_ac97_drvprobe(struct platform_device *pdev)
ret
=
snd_soc_register_component
(
&
pdev
->
dev
,
&
nuc900_ac97_component
,
&
nuc900_ac97_dai
,
1
);
if
(
ret
)
goto
out
3
;
goto
out
;
/* enbale ac97 multifunction pin */
mfp_set_groupg
(
nuc900_audio
->
dev
,
NULL
);
return
0
;
out3:
clk_put
(
nuc900_audio
->
clk
);
out2:
iounmap
(
nuc900_audio
->
mmio
);
out1:
release_mem_region
(
nuc900_audio
->
res
->
start
,
resource_size
(
nuc900_audio
->
res
));
out0:
kfree
(
nuc900_audio
);
out:
return
ret
;
}
...
...
@@ -391,12 +374,6 @@ static int nuc900_ac97_drvremove(struct platform_device *pdev)
{
snd_soc_unregister_component
(
&
pdev
->
dev
);
clk_put
(
nuc900_ac97_data
->
clk
);
iounmap
(
nuc900_ac97_data
->
mmio
);
release_mem_region
(
nuc900_ac97_data
->
res
->
start
,
resource_size
(
nuc900_ac97_data
->
res
));
kfree
(
nuc900_ac97_data
);
nuc900_ac97_data
=
NULL
;
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录