Power Supply Fixes for 5.17 cycle

Three regression fixes for the 5.17 cycle:
 
 1. build warning fix for power-supply documentation
 2. pointer size fix in cw2015 battery driver
 3. OOM handling in bq256xx charger driver
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmIOfbIACgkQ2O7X88g7
 +podwA/8D6MxlHY7/2DT7P7zOREjfD0PqaEycYSKGMJd7wPl7fnXnV8wwwPtUoeX
 0fQGSYSszVucumRnfk5tukJOR0ahgbFqRiA4p8VJKa1MQm5bLNlS9i7iCInO9v6+
 /G6eDIbpx5Bqf+YoevmyN7otfeXHuvm4Ozk8YtRRXSSlsMc/5wBXUhNugK7XHo5M
 JIYjOhpUrWszQo4gez5QeayZ5lK55nerm1loBd7Aaq+IvhpVg667ILFMBgDTYxJo
 LF8+1MBTGlA5B3ivTSIC7NPY2MAHuPjD9hZHlcxmC15qlFvTAeFd5OAgC4XXALEm
 8xY+HC4cn/ehzvLTwA/FPcax6MPOQE7P1hdUTdkoZiDaRTi9vuFoEinRA1379Uw/
 lqgoMZ+m+tFwKtgKFpM/27dOjtQ5U+bGtGELzdrPk+AMkq55I/9ixNIWCzh+7Sbx
 Yzww3iJBNgxw0HFRvFwf6tS1/+Vxko4JIEt6nLjI2aKPPSZxLFogH7F4RG6V24eF
 bJkm1ui6uzOPaHH5fynGs7pohAJSQC16suGreHp3qxJegIsHOrS8wrTTzMgiyoSD
 01cJmyGBfXm2QaJv3U2K5WsqO9OrASf1WNqw4eXXMxJNKiMv++QXcfxYVyjeclJi
 cGhxLeKryLOpiMYw50oKBn+Fq5nxhpLvL7WPo1jS8Ng30ieY0n4=
 =fzQU
 -----END PGP SIGNATURE-----

Merge tag 'for-v5.17-rc' of git://git.kernel.org/pub/scm/linux/kernel/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
This commit is contained in:
Linus Torvalds 2022-02-20 11:07:46 -08:00
commit 70d2bec7c5
3 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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");

View file

@ -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;