summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2021-07-13 18:27:08 +0300
committerSebastian Reichel <sebastian.reichel@collabora.com>2021-07-16 16:14:30 +0300
commit661d10ee0f1be7e3e08267b8364439980d02a42c (patch)
treec2a98c92bb9f5886ba4da0e21fd7b45e865e83b5 /drivers/power
parent484a9cc3dcb867813fca62f6443c1e77a1ae3c27 (diff)
downloadlinux-661d10ee0f1be7e3e08267b8364439980d02a42c.tar.xz
power: supply: ab8500: Rename charging algorithm psy
If we rename the "abx500_chargalg" supply to "ab8500_chargalg" as it should be named, the existing supplies are supplying that supply but that was obviously not working since it had the wrong name. Now that the dependency kicks in we get a bunch of NULL references from ab8500_chargalg_external_power_changed() so check that the workqueue is allocated before we try to queue work on it. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/ab8500_chargalg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/power/supply/ab8500_chargalg.c b/drivers/power/supply/ab8500_chargalg.c
index 8dd66eb18fd5..4ef34f64e9c0 100644
--- a/drivers/power/supply/ab8500_chargalg.c
+++ b/drivers/power/supply/ab8500_chargalg.c
@@ -1275,7 +1275,8 @@ static void ab8500_chargalg_external_power_changed(struct power_supply *psy)
* Trigger execution of the algorithm instantly and read
* all power_supply properties there instead
*/
- queue_work(di->chargalg_wq, &di->chargalg_work);
+ if (di->chargalg_wq)
+ queue_work(di->chargalg_wq, &di->chargalg_work);
}
/**
@@ -1949,7 +1950,7 @@ static char *supply_interface[] = {
};
static const struct power_supply_desc ab8500_chargalg_desc = {
- .name = "abx500_chargalg",
+ .name = "ab8500_chargalg",
.type = POWER_SUPPLY_TYPE_BATTERY,
.properties = ab8500_chargalg_props,
.num_properties = ARRAY_SIZE(ab8500_chargalg_props),