Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
eeed2279
K
Kernel
项目概览
openeuler
/
Kernel
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
eeed2279
编写于
1月 22, 2012
作者:
G
Geert Uytterhoeven
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
m68k/amiga: Add error checks when registering platform devices
Signed-off-by:
N
Geert Uytterhoeven
<
geert@linux-m68k.org
>
上级
943ce308
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
90 addition
and
32 deletion
+90
-32
arch/m68k/amiga/platform.c
arch/m68k/amiga/platform.c
+90
-32
未找到文件。
arch/m68k/amiga/platform.c
浏览文件 @
eeed2279
...
...
@@ -6,6 +6,7 @@
* for more details.
*/
#include <linux/err.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/zorro.h>
...
...
@@ -46,11 +47,18 @@ static const struct resource zorro_resources[] __initconst = {
static
int
__init
amiga_init_bus
(
void
)
{
struct
platform_device
*
pdev
;
unsigned
int
n
;
if
(
!
MACH_IS_AMIGA
||
!
AMIGAHW_PRESENT
(
ZORRO
))
return
-
ENODEV
;
platform_device_register_simple
(
"amiga-zorro"
,
-
1
,
zorro_resources
,
AMIGAHW_PRESENT
(
ZORRO3
)
?
4
:
2
);
n
=
AMIGAHW_PRESENT
(
ZORRO3
)
?
4
:
2
;
pdev
=
platform_device_register_simple
(
"amiga-zorro"
,
-
1
,
zorro_resources
,
n
);
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
return
0
;
}
...
...
@@ -126,70 +134,120 @@ static const struct resource amiga_rtc_resource __initconst = {
static
int
__init
amiga_init_devices
(
void
)
{
struct
platform_device
*
pdev
;
int
error
;
if
(
!
MACH_IS_AMIGA
)
return
-
ENODEV
;
/* video hardware */
if
(
AMIGAHW_PRESENT
(
AMI_VIDEO
))
platform_device_register_simple
(
"amiga-video"
,
-
1
,
NULL
,
0
);
if
(
AMIGAHW_PRESENT
(
AMI_VIDEO
))
{
pdev
=
platform_device_register_simple
(
"amiga-video"
,
-
1
,
NULL
,
0
);
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
}
/* sound hardware */
if
(
AMIGAHW_PRESENT
(
AMI_AUDIO
))
platform_device_register_simple
(
"amiga-audio"
,
-
1
,
NULL
,
0
);
if
(
AMIGAHW_PRESENT
(
AMI_AUDIO
))
{
pdev
=
platform_device_register_simple
(
"amiga-audio"
,
-
1
,
NULL
,
0
);
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
}
/* storage interfaces */
if
(
AMIGAHW_PRESENT
(
AMI_FLOPPY
))
platform_device_register_simple
(
"amiga-floppy"
,
-
1
,
NULL
,
0
);
if
(
AMIGAHW_PRESENT
(
AMI_FLOPPY
))
{
pdev
=
platform_device_register_simple
(
"amiga-floppy"
,
-
1
,
NULL
,
0
);
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
}
if
(
AMIGAHW_PRESENT
(
A3000_SCSI
))
platform_device_register_simple
(
"amiga-a3000-scsi"
,
-
1
,
&
a3000_scsi_resource
,
1
);
if
(
AMIGAHW_PRESENT
(
A3000_SCSI
))
{
pdev
=
platform_device_register_simple
(
"amiga-a3000-scsi"
,
-
1
,
&
a3000_scsi_resource
,
1
);
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
}
if
(
AMIGAHW_PRESENT
(
A4000_SCSI
))
platform_device_register_simple
(
"amiga-a4000t-scsi"
,
-
1
,
&
a4000t_scsi_resource
,
1
);
if
(
AMIGAHW_PRESENT
(
A4000_SCSI
))
{
pdev
=
platform_device_register_simple
(
"amiga-a4000t-scsi"
,
-
1
,
&
a4000t_scsi_resource
,
1
);
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
}
if
(
AMIGAHW_PRESENT
(
A1200_IDE
)
||
z_dev_present
(
ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530_SCSI_IDE
))
{
pdev
=
platform_device_register_simple
(
"amiga-gayle-ide"
,
-
1
,
&
a1200_ide_resource
,
1
);
platform_device_add_data
(
pdev
,
&
a1200_ide_pdata
,
sizeof
(
a1200_ide_pdata
));
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
error
=
platform_device_add_data
(
pdev
,
&
a1200_ide_pdata
,
sizeof
(
a1200_ide_pdata
));
if
(
error
)
return
error
;
}
if
(
AMIGAHW_PRESENT
(
A4000_IDE
))
{
pdev
=
platform_device_register_simple
(
"amiga-gayle-ide"
,
-
1
,
&
a4000_ide_resource
,
1
);
platform_device_add_data
(
pdev
,
&
a4000_ide_pdata
,
sizeof
(
a4000_ide_pdata
));
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
error
=
platform_device_add_data
(
pdev
,
&
a4000_ide_pdata
,
sizeof
(
a4000_ide_pdata
));
if
(
error
)
return
error
;
}
/* other I/O hardware */
if
(
AMIGAHW_PRESENT
(
AMI_KEYBOARD
))
platform_device_register_simple
(
"amiga-keyboard"
,
-
1
,
NULL
,
0
);
if
(
AMIGAHW_PRESENT
(
AMI_KEYBOARD
))
{
pdev
=
platform_device_register_simple
(
"amiga-keyboard"
,
-
1
,
NULL
,
0
);
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
}
if
(
AMIGAHW_PRESENT
(
AMI_MOUSE
))
platform_device_register_simple
(
"amiga-mouse"
,
-
1
,
NULL
,
0
);
if
(
AMIGAHW_PRESENT
(
AMI_MOUSE
))
{
pdev
=
platform_device_register_simple
(
"amiga-mouse"
,
-
1
,
NULL
,
0
);
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
}
if
(
AMIGAHW_PRESENT
(
AMI_SERIAL
))
platform_device_register_simple
(
"amiga-serial"
,
-
1
,
NULL
,
0
);
if
(
AMIGAHW_PRESENT
(
AMI_SERIAL
))
{
pdev
=
platform_device_register_simple
(
"amiga-serial"
,
-
1
,
NULL
,
0
);
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
}
if
(
AMIGAHW_PRESENT
(
AMI_PARALLEL
))
platform_device_register_simple
(
"amiga-parallel"
,
-
1
,
NULL
,
0
);
if
(
AMIGAHW_PRESENT
(
AMI_PARALLEL
))
{
pdev
=
platform_device_register_simple
(
"amiga-parallel"
,
-
1
,
NULL
,
0
);
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
}
/* real time clocks */
if
(
AMIGAHW_PRESENT
(
A2000_CLK
))
platform_device_register_simple
(
"rtc-msm6242"
,
-
1
,
&
amiga_rtc_resource
,
1
);
if
(
AMIGAHW_PRESENT
(
A2000_CLK
))
{
pdev
=
platform_device_register_simple
(
"rtc-msm6242"
,
-
1
,
&
amiga_rtc_resource
,
1
);
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
}
if
(
AMIGAHW_PRESENT
(
A3000_CLK
))
platform_device_register_simple
(
"rtc-rp5c01"
,
-
1
,
&
amiga_rtc_resource
,
1
);
if
(
AMIGAHW_PRESENT
(
A3000_CLK
))
{
pdev
=
platform_device_register_simple
(
"rtc-rp5c01"
,
-
1
,
&
amiga_rtc_resource
,
1
);
if
(
IS_ERR
(
pdev
))
return
PTR_ERR
(
pdev
);
}
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录