Skip to content

Commit

Permalink
Merge tag 'for-v5.17-rc' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/sre/linux-power-supply

Pull power supply fixes from Sebastian Reichel:
 "Three regression fixes for the 5.17 cycle:

   - build warning fix for power-supply documentation

   - pointer size fix in cw2015 battery driver

   - OOM handling in bq256xx charger driver"

* tag 'for-v5.17-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply:
  power: supply: bq256xx: Handle OOM correctly
  power: supply: core: fix application of sizeof to pointer
  power: supply: fix table problem in sysfs-class-power
  • Loading branch information
Linus Torvalds committed Feb 20, 2022
2 parents 7f25f04 + f444578 commit 70d2bec
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions Documentation/ABI/testing/sysfs-class-power
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ Description:
auto: Charge normally, respect thresholds
inhibit-charge: Do not charge while AC is attached
force-discharge: Force discharge while AC is attached
================ ====================================

What: /sys/class/power_supply/<supply_name>/technology
Date: May 2007
Expand Down
3 changes: 3 additions & 0 deletions drivers/power/supply/bq256xx_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,9 @@ static int bq256xx_hw_init(struct bq256xx_device *bq)
BQ256XX_WDT_BIT_SHIFT);

ret = power_supply_get_battery_info(bq->charger, &bat_info);
if (ret == -ENOMEM)
return ret;

if (ret) {
dev_warn(bq->dev, "battery info missing, default values will be applied\n");

Expand Down
2 changes: 1 addition & 1 deletion drivers/power/supply/cw2015_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ static int cw_bat_probe(struct i2c_client *client)
if (ret) {
/* Allocate an empty battery */
cw_bat->battery = devm_kzalloc(&client->dev,
sizeof(cw_bat->battery),
sizeof(*cw_bat->battery),
GFP_KERNEL);
if (!cw_bat->battery)
return -ENOMEM;
Expand Down

0 comments on commit 70d2bec

Please sign in to comment.