Loading drivers/acpi/battery.c +15 −0 Original line number Original line Diff line number Diff line Loading @@ -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) -------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */ Loading @@ -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 { Loading Loading @@ -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 { Loading Loading @@ -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; Loading Loading @@ -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; Loading Loading
drivers/acpi/battery.c +15 −0 Original line number Original line Diff line number Diff line Loading @@ -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) -------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */ Loading @@ -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 { Loading Loading @@ -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 { Loading Loading @@ -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; Loading Loading @@ -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; Loading