Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
ff9046ac
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看板
提交
ff9046ac
编写于
3月 31, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bfin_adv7393: switch to proc_create_data()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
a69755b1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
24 deletion
+19
-24
drivers/video/bfin_adv7393fb.c
drivers/video/bfin_adv7393fb.c
+19
-24
未找到文件。
drivers/video/bfin_adv7393fb.c
浏览文件 @
ff9046ac
...
...
@@ -333,29 +333,23 @@ static int proc_output(char *buf)
return
p
-
buf
;
}
static
in
t
adv7393_read_proc
(
char
*
page
,
char
**
start
,
off_t
of
f
,
int
count
,
int
*
eof
,
void
*
data
)
static
ssize_
t
adv7393_read_proc
(
struct
file
*
file
,
char
__user
*
bu
f
,
size_t
size
,
loff_t
*
ppos
)
{
int
len
;
len
=
proc_output
(
page
);
if
(
len
<=
off
+
count
)
*
eof
=
1
;
*
start
=
page
+
off
;
len
-=
off
;
if
(
len
>
count
)
len
=
count
;
if
(
len
<
0
)
len
=
0
;
return
len
;
static
const
char
message
[]
=
"Usage:
\n
"
"echo 0x[REG][Value] > adv7393
\n
"
"example: echo 0x1234 >adv7393
\n
"
"writes 0x34 into Register 0x12
\n
"
;
return
simple_read_from_buffer
(
buf
,
size
,
ppos
,
message
,
sizeof
(
message
));
}
static
in
t
static
ssize_
t
adv7393_write_proc
(
struct
file
*
file
,
const
char
__user
*
buffer
,
size_t
count
,
void
*
data
)
size_t
count
,
loff_t
*
ppos
)
{
struct
adv7393fb_device
*
fbdev
=
data
;
struct
adv7393fb_device
*
fbdev
=
PDE
(
file_inode
(
file
))
->
data
;
unsigned
int
val
;
int
ret
;
...
...
@@ -368,6 +362,12 @@ adv7393_write_proc(struct file *file, const char __user * buffer,
return
count
;
}
static
const
struct
file_operations
fops
=
{
.
read
=
adv7393_read_proc
,
.
write
=
adv7393_write_proc
,
.
llseek
=
default_llseek
,
};
static
int
bfin_adv7393_fb_probe
(
struct
i2c_client
*
client
,
const
struct
i2c_device_id
*
id
)
{
...
...
@@ -506,17 +506,12 @@ static int bfin_adv7393_fb_probe(struct i2c_client *client,
fbdev
->
info
.
node
,
fbdev
->
info
.
fix
.
id
);
dev_info
(
&
client
->
dev
,
"fb memory address : 0x%p
\n
"
,
fbdev
->
fb_mem
);
entry
=
create_proc_entry
(
"driver/adv7393"
,
0
,
NULL
);
entry
=
proc_create_data
(
"driver/adv7393"
,
0
,
NULL
,
&
fops
,
fbdev
);
if
(
!
entry
)
{
dev_err
(
&
client
->
dev
,
"unable to create /proc entry
\n
"
);
ret
=
-
EFAULT
;
goto
free_fb
;
}
entry
->
read_proc
=
adv7393_read_proc
;
entry
->
write_proc
=
adv7393_write_proc
;
entry
->
data
=
fbdev
;
return
0
;
free_fb:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录