提交 50b17851 编写于 作者: A Alexey Starikovskiy 提交者: Len Brown

Newly inserted battery might differ from one just removed, so

update of battery info fields is required.
Signed-off-by: NAlexey Starikovskiy <astarikovskiy@suse.de>
Acked-by: NAndy Neitzke <neitzke@ias.edu>

Signed-off-by: Alexey Starikovskiy <astarikovskiy <at> suse.de>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 3d44cc3e
......@@ -471,7 +471,7 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
static int acpi_battery_update(struct acpi_battery *battery)
{
int result;
int result, old_present = acpi_battery_present(battery);
result = acpi_battery_get_status(battery);
if (result)
return result;
......@@ -482,7 +482,8 @@ static int acpi_battery_update(struct acpi_battery *battery)
return 0;
}
#endif
if (!battery->update_time) {
if (!battery->update_time ||
old_present != acpi_battery_present(battery)) {
result = acpi_battery_get_info(battery);
if (result)
return result;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册