ACPI: battery: remove redundant old_present check on insertion
authorLucas Rangit Magasweran <lucas.magasweran@ieee.org>
Sat, 14 Jul 2018 22:40:18 +0000 (15:40 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 24 Jul 2018 09:22:03 +0000 (11:22 +0200)
commit82f2d30570b7ecdf1ce7e6376805f063ae86a7e5
tree85558698e99f0701f9cb488ac62e403e43ee2354
parent9d3cce1e8b8561fed5f383d22a4d6949db4eadbe
ACPI: battery: remove redundant old_present check on insertion

On removal battery_present changes from 1 to 0 after calling
acpi_battery_get_status() and battery->update_time is set to 0
before returning.

On insertion battery_present changes from 0 to 1 after calling
acpi_battery_get_status() and acpi_battery_get_info() is called
because battery->update_time is 0.

The old_present condition is therefore redundant.

This was added in the commit below when there was a path without
sysfs that would skip getting the newly inserted battery info.

commit 50b178512b7d ("Newly inserted battery might differ from one
just removed, so update of battery info fields is required.")

Signed-off-by: Lucas Rangit Magasweran <lucas.magasweran@ieee.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/battery.c