Skip to content

Commit 49dcc4f

Browse files
committed
Merge tag 'acpi-6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fix from Rafael Wysocki: "Revert a problematic ACPI battery driver change merged recently" * tag 'acpi-6.16-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: Revert "ACPI: battery: negate current when discharging"
2 parents b1bf2ef + de1675d commit 49dcc4f

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

drivers/acpi/battery.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -243,23 +243,10 @@ static int acpi_battery_get_property(struct power_supply *psy,
243243
break;
244244
case POWER_SUPPLY_PROP_CURRENT_NOW:
245245
case POWER_SUPPLY_PROP_POWER_NOW:
246-
if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN) {
246+
if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN)
247247
ret = -ENODEV;
248-
break;
249-
}
250-
251-
val->intval = battery->rate_now * 1000;
252-
/*
253-
* When discharging, the current should be reported as a
254-
* negative number as per the power supply class interface
255-
* definition.
256-
*/
257-
if (psp == POWER_SUPPLY_PROP_CURRENT_NOW &&
258-
(battery->state & ACPI_BATTERY_STATE_DISCHARGING) &&
259-
acpi_battery_handle_discharging(battery)
260-
== POWER_SUPPLY_STATUS_DISCHARGING)
261-
val->intval = -val->intval;
262-
248+
else
249+
val->intval = battery->rate_now * 1000;
263250
break;
264251
case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
265252
case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:

0 commit comments

Comments
 (0)