Skip to contentSkip to conversation

power: supply: bq2415x_charger: Immediately reschedule delayed work on notifier events

PATCH Applied Sicelo A. Mhlongo 2 participants 2 messages Dec 21, 2024 – Dec 23, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 power: supply: bq2415x_charger: Immediately reschedule delayed work on notifier events

When the notifier is called we want to schedule the worker as soon as possible. Thus it makes sense to reschedule any waiting work and only queue a new one if there is none.

---
* Changes from v1:
- Reworded the commit description per comments from v1 review

 drivers/power/supply/bq2415x_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/bq2415x_charger.c +1 -1
index 18a6c3dbc758..22f6a3b71632 100644
@@ -842,7 +842,7 @@ static int bq2415x_notifier_call(struct notifier_block *nb,
 	if (bq->automode < 1)
 		return NOTIFY_OK;
 
-	schedule_delayed_work(&bq->work, 0);
+	mod_delayed_work(system_wq, &bq->work, 0);
 
 	return NOTIFY_OK;
 }
Signature · 1 line
2.45.2
#1 lore raw
Quoted 5 lines · Sicelo A. Mhlongo

When the notifier is called we want to schedule the worker as soon as possible. Thus it makes sense to reschedule any waiting work and only queue a new one if there is none.

Applied, thanks!

[1/1] power: supply: bq2415x_charger: Immediately reschedule delayed work on notifier events

      commit: f6945d52ee5346900fb7251ec23d34822a06918e

Best regards,

Signature · 1 line
Sebastian Reichel <[email protected]>