Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
ff9046ac
Commit
ff9046ac
authored
Mar 31, 2013
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bfin_adv7393: switch to proc_create_data()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
a69755b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
24 deletions
+19
-24
drivers/video/bfin_adv7393fb.c
drivers/video/bfin_adv7393fb.c
+19
-24
No files found.
drivers/video/bfin_adv7393fb.c
View file @
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:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment