All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Sebastian Reichel <sre@kernel.org>, Marcus Cooper <codekipper@gmail.com>
Cc: linux-pm@vger.kernel.org, Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH 4/5] power: supply: ab8500: Rename charging algorithm psy
Date: Tue, 13 Jul 2021 17:27:08 +0200	[thread overview]
Message-ID: <20210713152709.871833-4-linus.walleij@linaro.org> (raw)
In-Reply-To: <20210713152709.871833-1-linus.walleij@linaro.org>

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>
---
 drivers/power/supply/ab8500_chargalg.c | 5 +++--
 1 file 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),
-- 
2.31.1


  parent reply	other threads:[~2021-07-13 15:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 15:27 [PATCH 1/5] power: supply: ab8500: Use library interpolation Linus Walleij
2021-07-13 15:27 ` [PATCH 2/5] power: supply: ab8500: Rename charging algorithm symbols Linus Walleij
2021-07-13 15:27 ` [PATCH 3/5] power: supply: ab8500: Drop abx500 concept Linus Walleij
2021-07-13 15:27 ` Linus Walleij [this message]
2021-07-13 15:27 ` [PATCH 5/5] power: supply: ab8500: Drop some includes from bmdata Linus Walleij
2021-07-16 13:58 ` [PATCH 1/5] power: supply: ab8500: Use library interpolation Sebastian Reichel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210713152709.871833-4-linus.walleij@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=codekipper@gmail.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.