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 /drivers/acpi | |
parent | 1004879f25c5719517b3d8a3180a517e190e2f5b (diff) | |
parent | 4bd35cdb1e2d1a1bbbe4b75132718e79b80519ab (diff) | |
download | linux-rpi3-4559b438225b01942e1661759db0df55883b1bc0.tar.gz linux-rpi3-4559b438225b01942e1661759db0df55883b1bc0.tar.bz2 linux-rpi3-4559b438225b01942e1661759db0df55883b1bc0.zip |
Pull bugzilla-7200 into release branch
Diffstat (limited to 'drivers/acpi')
-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) return result; } +static void acpi_battery_check_present(struct acpi_battery *battery) +{ + if (!battery->flags.present) { + acpi_battery_check(battery); + } +} + /* -------------------------------------------------------------------------- FS Interface (/proc) -------------------------------------------------------------------------- */ @@ -339,6 +346,8 @@ static int acpi_battery_read_info(struct seq_file *seq, void *offset) if (!battery) goto end; + acpi_battery_check_present(battery); + if (battery->flags.present) seq_printf(seq, "present: yes\n"); else { @@ -423,6 +432,8 @@ static int acpi_battery_read_state(struct seq_file *seq, void *offset) if (!battery) goto end; + acpi_battery_check_present(battery); + if (battery->flags.present) seq_printf(seq, "present: yes\n"); else { @@ -498,6 +509,8 @@ static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) if (!battery) goto end; + acpi_battery_check_present(battery); + if (!battery->flags.present) { seq_printf(seq, "present: no\n"); goto end; @@ -535,6 +548,8 @@ acpi_battery_write_alarm(struct file *file, if (!battery || (count > sizeof(alarm_string) - 1)) return -EINVAL; + acpi_battery_check_present(battery); + if (!battery->flags.present) return -ENODEV; |