Commit 28222dcd authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ACPI support fix from Rafael Wysocki:
 "Unbreak system wakeup on critical battery status in the ACPI battery
  driver inadvertently broken during the 7.0 development cycle"

* tag 'acpi-7.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: battery: Fix system wakeup on critical battery status
parents ef7f594f c35cb4fc
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ struct acpi_battery {
	struct power_supply *bat;
	struct power_supply_desc bat_desc;
	struct acpi_device *device;
	struct device *phys_dev;
	struct notifier_block pm_nb;
	struct list_head list;
	unsigned long update_time;
@@ -1033,7 +1034,7 @@ static int acpi_battery_update(struct acpi_battery *battery, bool resume)
	if ((battery->state & ACPI_BATTERY_STATE_CRITICAL) ||
	    (test_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags) &&
	     (battery->capacity_now <= battery->alarm)))
		acpi_pm_wakeup_event(&battery->device->dev);
		acpi_pm_wakeup_event(battery->phys_dev);

	return result;
}
@@ -1231,6 +1232,7 @@ static int acpi_battery_probe(struct platform_device *pdev)

	platform_set_drvdata(pdev, battery);

	battery->phys_dev = &pdev->dev;
	battery->device = device;

	result = devm_mutex_init(&pdev->dev, &battery->update_lock);