Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
27167e0e
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
提交
27167e0e
编写于
8月 27, 2008
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
parport_sunbpp: Convert to pure OF driver.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
8e912b33
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
27 deletion
+20
-27
drivers/parport/parport_sunbpp.c
drivers/parport/parport_sunbpp.c
+20
-27
未找到文件。
drivers/parport/parport_sunbpp.c
浏览文件 @
27167e0e
...
...
@@ -26,6 +26,8 @@
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/parport.h>
...
...
@@ -34,7 +36,6 @@
#include <asm/io.h>
#include <asm/oplib.h>
/* OpenProm Library */
#include <asm/sbus.h>
#include <asm/dma.h>
/* BPP uses LSI 64854 for DMA */
#include <asm/irq.h>
#include <asm/sunbpp.h>
...
...
@@ -285,38 +286,37 @@ static struct parport_operations parport_sunbpp_ops =
.
owner
=
THIS_MODULE
,
};
static
int
__devinit
init_one_port
(
struct
sbus_dev
*
sdev
)
static
int
__devinit
bpp_probe
(
struct
of_device
*
op
,
const
struct
of_device_id
*
match
)
{
struct
parport
*
p
;
/* at least in theory there may be a "we don't dma" case */
struct
parport_operations
*
ops
;
void
__iomem
*
base
;
int
irq
,
dma
,
err
=
0
,
size
;
struct
bpp_regs
__iomem
*
regs
;
int
irq
,
dma
,
err
=
0
,
size
;
unsigned
char
value_tcr
;
void
__iomem
*
base
;
struct
parport
*
p
;
irq
=
sdev
->
irqs
[
0
];
base
=
sbus_ioremap
(
&
sdev
->
resource
[
0
],
0
,
sdev
->
reg_addrs
[
0
].
reg_size
,
"sunbpp"
);
irq
=
op
->
irqs
[
0
];
base
=
of_ioremap
(
&
op
->
resource
[
0
],
0
,
resource_size
(
&
op
->
resource
[
0
]),
"sunbpp"
);
if
(
!
base
)
return
-
ENODEV
;
size
=
sdev
->
reg_addrs
[
0
].
reg_size
;
size
=
resource_size
(
&
op
->
resource
[
0
])
;
dma
=
PARPORT_DMA_NONE
;
ops
=
kmalloc
(
sizeof
(
struct
parport_operations
),
GFP_KERNEL
);
if
(
!
ops
)
goto
out_unmap
;
memcpy
(
ops
,
&
parport_sunbpp_ops
,
sizeof
(
struct
parport_operations
));
memcpy
(
ops
,
&
parport_sunbpp_ops
,
sizeof
(
struct
parport_operations
));
dprintk
((
"register_port
\n
"
));
if
(
!
(
p
=
parport_register_port
((
unsigned
long
)
base
,
irq
,
dma
,
ops
)))
goto
out_free_ops
;
p
->
size
=
size
;
p
->
dev
=
&
sdev
->
ofdev
.
dev
;
p
->
dev
=
&
op
->
dev
;
if
((
err
=
request_irq
(
p
->
irq
,
parport_irq_handler
,
IRQF_SHARED
,
p
->
name
,
p
))
!=
0
)
{
...
...
@@ -333,7 +333,7 @@ static int __devinit init_one_port(struct sbus_dev *sdev)
printk
(
KERN_INFO
"%s: sunbpp at 0x%lx
\n
"
,
p
->
name
,
p
->
base
);
dev_set_drvdata
(
&
sdev
->
ofdev
.
dev
,
p
);
dev_set_drvdata
(
&
op
->
dev
,
p
);
parport_announce_port
(
p
);
...
...
@@ -346,21 +346,14 @@ static int __devinit init_one_port(struct sbus_dev *sdev)
kfree
(
ops
);
out_unmap:
sbus_iounmap
(
base
,
size
);
of_iounmap
(
&
op
->
resource
[
0
],
base
,
size
);
return
err
;
}
static
int
__devinit
bpp_probe
(
struct
of_device
*
dev
,
const
struct
of_device_id
*
match
)
{
struct
sbus_dev
*
sdev
=
to_sbus_device
(
&
dev
->
dev
);
return
init_one_port
(
sdev
);
}
static
int
__devexit
bpp_remove
(
struct
of_device
*
dev
)
static
int
__devexit
bpp_remove
(
struct
of_device
*
op
)
{
struct
parport
*
p
=
dev_get_drvdata
(
&
dev
->
dev
);
struct
parport
*
p
=
dev_get_drvdata
(
&
op
->
dev
);
struct
parport_operations
*
ops
=
p
->
ops
;
parport_remove_port
(
p
);
...
...
@@ -370,11 +363,11 @@ static int __devexit bpp_remove(struct of_device *dev)
free_irq
(
p
->
irq
,
p
);
}
sbus_iounmap
(
(
void
__iomem
*
)
p
->
base
,
p
->
size
);
of_iounmap
(
&
op
->
resource
[
0
],
(
void
__iomem
*
)
p
->
base
,
p
->
size
);
parport_put_port
(
p
);
kfree
(
ops
);
dev_set_drvdata
(
&
dev
->
dev
,
NULL
);
dev_set_drvdata
(
&
op
->
dev
,
NULL
);
return
0
;
}
...
...
@@ -397,7 +390,7 @@ static struct of_platform_driver bpp_sbus_driver = {
static
int
__init
parport_sunbpp_init
(
void
)
{
return
of_register_driver
(
&
bpp_sbus_driver
,
&
sbus
_bus_type
);
return
of_register_driver
(
&
bpp_sbus_driver
,
&
of
_bus_type
);
}
static
void
__exit
parport_sunbpp_exit
(
void
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录