From: Sicelo A. Mhlongo Date: Sat, 21 Dec 2024 16:10:23 +0000 (+0200) Subject: power: supply: bq2415x_charger: Immediately reschedule delayed work on notifier events X-Git-Tag: v6.14-rc1~71^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6945d52ee5346900fb7251ec23d34822a06918e;p=thirdparty%2Fkernel%2Flinux.git 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. Suggested-by: Ivaylo Dimitrov Signed-off-by: Sicelo A. Mhlongo Link: https://lore.kernel.org/r/20241221161124.114989-1-absicsz@gmail.com Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/supply/bq2415x_charger.c b/drivers/power/supply/bq2415x_charger.c index 18a6c3dbc7583..22f6a3b71632b 100644 --- a/drivers/power/supply/bq2415x_charger.c +++ b/drivers/power/supply/bq2415x_charger.c @@ -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; }