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
nexedi
linux
Commits
4559b438
Commit
4559b438
authored
Feb 16, 2007
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Pull bugzilla-7200 into release branch
parents
1004879f
4bd35cdb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
drivers/acpi/battery.c
drivers/acpi/battery.c
+15
-0
No files found.
drivers/acpi/battery.c
View file @
4559b438
...
@@ -323,6 +323,13 @@ static int acpi_battery_check(struct acpi_battery *battery)
...
@@ -323,6 +323,13 @@ static int acpi_battery_check(struct acpi_battery *battery)
return
result
;
return
result
;
}
}
static
void
acpi_battery_check_present
(
struct
acpi_battery
*
battery
)
{
if
(
!
battery
->
flags
.
present
)
{
acpi_battery_check
(
battery
);
}
}
/* --------------------------------------------------------------------------
/* --------------------------------------------------------------------------
FS Interface (/proc)
FS Interface (/proc)
-------------------------------------------------------------------------- */
-------------------------------------------------------------------------- */
...
@@ -339,6 +346,8 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset)
...
@@ -339,6 +346,8 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset)
if
(
!
battery
)
if
(
!
battery
)
goto
end
;
goto
end
;
acpi_battery_check_present
(
battery
);
if
(
battery
->
flags
.
present
)
if
(
battery
->
flags
.
present
)
seq_printf
(
seq
,
"present: yes
\n
"
);
seq_printf
(
seq
,
"present: yes
\n
"
);
else
{
else
{
...
@@ -423,6 +432,8 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
...
@@ -423,6 +432,8 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset)
if
(
!
battery
)
if
(
!
battery
)
goto
end
;
goto
end
;
acpi_battery_check_present
(
battery
);
if
(
battery
->
flags
.
present
)
if
(
battery
->
flags
.
present
)
seq_printf
(
seq
,
"present: yes
\n
"
);
seq_printf
(
seq
,
"present: yes
\n
"
);
else
{
else
{
...
@@ -498,6 +509,8 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)
...
@@ -498,6 +509,8 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset)
if
(
!
battery
)
if
(
!
battery
)
goto
end
;
goto
end
;
acpi_battery_check_present
(
battery
);
if
(
!
battery
->
flags
.
present
)
{
if
(
!
battery
->
flags
.
present
)
{
seq_printf
(
seq
,
"present: no
\n
"
);
seq_printf
(
seq
,
"present: no
\n
"
);
goto
end
;
goto
end
;
...
@@ -535,6 +548,8 @@ acpi_battery_write_alarm(struct file *file,
...
@@ -535,6 +548,8 @@ acpi_battery_write_alarm(struct file *file,
if
(
!
battery
||
(
count
>
sizeof
(
alarm_string
)
-
1
))
if
(
!
battery
||
(
count
>
sizeof
(
alarm_string
)
-
1
))
return
-
EINVAL
;
return
-
EINVAL
;
acpi_battery_check_present
(
battery
);
if
(
!
battery
->
flags
.
present
)
if
(
!
battery
->
flags
.
present
)
return
-
ENODEV
;
return
-
ENODEV
;
...
...
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