提交 e363a755 编写于 作者: A Alan Jenkins 提交者: Len Brown

ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n

Disabling CONFIG_ACPI_SYSFS_POWER changes the behaviour of
acpi_battery_update().  It will call acpi_battery_get_info()
even if the battery is not present.  I haven't noticed this
causing any problem, but it does look like a bad idea.
Signed-off-by: NAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Acked-by: NAlexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 2eaa9cfd
......@@ -567,13 +567,13 @@ static int acpi_battery_update(struct acpi_battery *battery)
result = acpi_battery_get_status(battery);
if (result)
return result;
#ifdef CONFIG_ACPI_SYSFS_POWER
if (!acpi_battery_present(battery)) {
#ifdef CONFIG_ACPI_SYSFS_POWER
sysfs_remove_battery(battery);
#endif
battery->update_time = 0;
return 0;
}
#endif
if (!battery->update_time ||
old_present != acpi_battery_present(battery)) {
result = acpi_battery_get_info(battery);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册