]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
power: supply: lenovo_yoga_c630_battery: register power supplies with power_supply_re...
authorThomas Weißschuh <linux@weissschuh.net>
Sat, 5 Oct 2024 10:05:08 +0000 (12:05 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Tue, 15 Oct 2024 20:22:21 +0000 (22:22 +0200)
{,devm_}power_supply_register_no_ws() are going to be removed.
Switch to the general registration API.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20241005-power-supply-no-wakeup-source-v1-6-1d62bf9bcb1d@weissschuh.net
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/lenovo_yoga_c630_battery.c

index f98f65e00831a5c463b133f7c074182c7db00e7e..7a6c8af9e8c24810abf2b6448fe061991738f87c 100644 (file)
@@ -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);