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
1a21cc1e
Commit
1a21cc1e
authored
Nov 15, 2002
by
Aristeu Sergio Rozanski Filho
Committed by
Arnaldo Carvalho de Melo
Nov 15, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
o acpi: convert drivers/acpi/button.c to seq_file
parent
ea7b8e05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
25 deletions
+20
-25
drivers/acpi/button.c
drivers/acpi/button.c
+20
-25
No files found.
drivers/acpi/button.c
View file @
1a21cc1e
...
...
@@ -29,6 +29,7 @@
#include <linux/types.h>
#include <linux/compatmac.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include "acpi_bus.h"
#include "acpi_drivers.h"
...
...
@@ -69,6 +70,7 @@ MODULE_LICENSE("GPL");
int
acpi_button_add
(
struct
acpi_device
*
device
);
int
acpi_button_remove
(
struct
acpi_device
*
device
,
int
type
);
static
int
acpi_button_open_fs
(
struct
inode
*
inode
,
struct
file
*
file
);
static
struct
acpi_driver
acpi_button_driver
=
{
.
name
=
ACPI_BUTTON_DRIVER_NAME
,
...
...
@@ -87,6 +89,12 @@ struct acpi_button {
unsigned
long
pushed
;
};
static
struct
file_operations
acpi_button_fops
=
{
.
open
=
acpi_button_open_fs
,
.
read
=
seq_read
,
.
llseek
=
seq_lseek
,
.
release
=
single_release
,
};
/* --------------------------------------------------------------------------
FS Interface (/proc)
...
...
@@ -94,39 +102,26 @@ struct acpi_button {
static
struct
proc_dir_entry
*
acpi_button_dir
=
NULL
;
static
int
acpi_button_read_info
(
char
*
page
,
char
**
start
,
off_t
off
,
int
count
,
int
*
eof
,
void
*
data
)
static
int
acpi_button_seq_show
(
struct
seq_file
*
seq
,
void
*
offset
)
{
struct
acpi_button
*
button
=
(
struct
acpi_button
*
)
data
;
char
*
p
=
page
;
int
len
=
0
;
struct
acpi_button
*
button
=
(
struct
acpi_button
*
)
seq
->
private
;
ACPI_FUNCTION_TRACE
(
"acpi_button_
read_info
"
);
ACPI_FUNCTION_TRACE
(
"acpi_button_
seq_show
"
);
if
(
!
button
||
!
button
->
device
)
goto
end
;
return
0
;
p
+=
sprintf
(
p
,
"type: %s
\n
"
,
seq_printf
(
seq
,
"type: %s
\n
"
,
acpi_device_name
(
button
->
device
));
end:
len
=
(
p
-
page
);
if
(
len
<=
off
+
count
)
*
eof
=
1
;
*
start
=
page
+
off
;
len
-=
off
;
if
(
len
>
count
)
len
=
count
;
if
(
len
<
0
)
len
=
0
;
return_VALUE
(
len
);
return
0
;
}
static
int
acpi_button_open_fs
(
struct
inode
*
inode
,
struct
file
*
file
)
{
return
single_open
(
file
,
acpi_button_seq_show
,
PDE
(
inode
)
->
data
);
}
static
int
acpi_button_add_fs
(
struct
acpi_device
*
device
)
...
...
@@ -176,7 +171,7 @@ acpi_button_add_fs (
"Unable to create '%s' fs entry
\n
"
,
ACPI_BUTTON_FILE_INFO
));
else
{
entry
->
read_proc
=
acpi_button_read_info
;
entry
->
proc_fops
=
&
acpi_button_fops
;
entry
->
data
=
acpi_driver_data
(
device
);
}
...
...
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