diff options
author | Len Brown <len.brown@intel.com> | 2007-02-16 22:11:37 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-02-16 22:11:37 -0500 |
commit | 4559b438225b01942e1661759db0df55883b1bc0 (patch) | |
tree | 2c47cd8b33e8ef2db4e3ae17467170b1cc508f4d | |
parent | 1004879f25c5719517b3d8a3180a517e190e2f5b (diff) | |
parent | 4bd35cdb1e2d1a1bbbe4b75132718e79b80519ab (diff) |
Pull bugzilla-7200 into release branch
-rw-r--r-- | drivers/acpi/battery.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 02de49ef1bce..e64c76c8b726 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -323,6 +323,13 @@ static int acpi_battery_check(struct acpi_battery *battery) | |||
323 | return result; | 323 | return result; |
324 | } | 324 | } |
325 | 325 | ||
326 | static void acpi_battery_check_present(struct acpi_battery *battery) | ||
327 | { | ||
328 | if (!battery->flags.present) { | ||
329 | acpi_battery_check(battery); | ||
330 | } | ||
331 | } | ||
332 | |||
326 | /* -------------------------------------------------------------------------- | 333 | /* -------------------------------------------------------------------------- |
327 | FS Interface (/proc) | 334 | FS Interface (/proc) |
328 | -------------------------------------------------------------------------- */ | 335 | -------------------------------------------------------------------------- */ |
@@ -339,6 +346,8 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset) | |||
339 | if (!battery) | 346 | if (!battery) |
340 | goto end; | 347 | goto end; |
341 | 348 | ||
349 | acpi_battery_check_present(battery); | ||
350 | |||
342 | if (battery->flags.present) | 351 | if (battery->flags.present) |
343 | seq_printf(seq, "present: yes\n"); | 352 | seq_printf(seq, "present: yes\n"); |
344 | else { | 353 | else { |
@@ -423,6 +432,8 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset) | |||
423 | if (!battery) | 432 | if (!battery) |
424 | goto end; | 433 | goto end; |
425 | 434 | ||
435 | acpi_battery_check_present(battery); | ||
436 | |||
426 | if (battery->flags.present) | 437 | if (battery->flags.present) |
427 | seq_printf(seq, "present: yes\n"); | 438 | seq_printf(seq, "present: yes\n"); |
428 | else { | 439 | else { |
@@ -498,6 +509,8 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) | |||
498 | if (!battery) | 509 | if (!battery) |
499 | goto end; | 510 | goto end; |
500 | 511 | ||
512 | acpi_battery_check_present(battery); | ||
513 | |||
501 | if (!battery->flags.present) { | 514 | if (!battery->flags.present) { |
502 | seq_printf(seq, "present: no\n"); | 515 | seq_printf(seq, "present: no\n"); |
503 | goto end; | 516 | goto end; |
@@ -535,6 +548,8 @@ acpi_battery_write_alarm(struct file *file, | |||
535 | if (!battery || (count > sizeof(alarm_string) - 1)) | 548 | if (!battery || (count > sizeof(alarm_string) - 1)) |
536 | return -EINVAL; | 549 | return -EINVAL; |
537 | 550 | ||
551 | acpi_battery_check_present(battery); | ||
552 | |||
538 | if (!battery->flags.present) | 553 | if (!battery->flags.present) |
539 | return -ENODEV; | 554 | return -ENODEV; |
540 | 555 | ||