[PATCH 6/8] power: supply: lenovo_yoga_c630_battery: register power supplies with power_supply_register()

From: Thomas Weißschuh
Date: Sat Oct 05 2024 - 06:08:25 EST


{,devm_}power_supply_register_no_ws() are going to be removed.
Switch to the general registration API.

Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
---
drivers/power/supply/lenovo_yoga_c630_battery.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/power/supply/lenovo_yoga_c630_battery.c b/drivers/power/supply/lenovo_yoga_c630_battery.c
index f98f65e00831a5c463b133f7c074182c7db00e7e..7a6c8af9e8c24810abf2b6448fe061991738f87c 100644
--- a/drivers/power/supply/lenovo_yoga_c630_battery.c
+++ b/drivers/power/supply/lenovo_yoga_c630_battery.c
@@ -368,11 +368,12 @@ static int yoga_c630_psy_register_bat_psy(struct yoga_c630_psy *ecbat)

bat_cfg.drv_data = ecbat;
bat_cfg.fwnode = ecbat->fwnode;
- ecbat->bat_psy = power_supply_register_no_ws(ecbat->dev,
- ecbat->unit_mA ?
- &yoga_c630_psy_bat_psy_desc_mA :
- &yoga_c630_psy_bat_psy_desc_mWh,
- &bat_cfg);
+ bat_cfg.no_wakeup_source = true;
+ ecbat->bat_psy = power_supply_register(ecbat->dev,
+ ecbat->unit_mA ?
+ &yoga_c630_psy_bat_psy_desc_mA :
+ &yoga_c630_psy_bat_psy_desc_mWh,
+ &bat_cfg);
if (IS_ERR(ecbat->bat_psy)) {
dev_err(ecbat->dev, "failed to register battery supply\n");
return PTR_ERR(ecbat->bat_psy);
@@ -442,7 +443,8 @@ static int yoga_c630_psy_probe(struct auxiliary_device *adev,
adp_cfg.fwnode = ecbat->fwnode;
adp_cfg.supplied_to = (char **)&yoga_c630_psy_bat_psy_desc_mA.name;
adp_cfg.num_supplicants = 1;
- ecbat->adp_psy = devm_power_supply_register_no_ws(dev, &yoga_c630_psy_adpt_psy_desc, &adp_cfg);
+ adp_cfg.no_wakeup_source = true;
+ ecbat->adp_psy = devm_power_supply_register(dev, &yoga_c630_psy_adpt_psy_desc, &adp_cfg);
if (IS_ERR(ecbat->adp_psy)) {
dev_err(dev, "failed to register AC adapter supply\n");
return PTR_ERR(ecbat->adp_psy);

--
2.46.2