diff mbox series

[v4] rtc: Replace flush_scheduled_work() with flush_work().

Message ID 8d3a0f55-d861-ba93-0d25-b1172eaa8343@I-love.SAKURA.ne.jp
State Accepted
Headers show
Series [v4] rtc: Replace flush_scheduled_work() with flush_work(). | expand

Commit Message

Tetsuo Handa June 10, 2022, 10:48 a.m. UTC
Since "struct rtc_device" is per a device struct, I assume that clear_uie()
needs to wait for only one work associated with that device. Therefore,
wait for only that work using flush_work().

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
Please see commit c4f135d643823a86 ("workqueue: Wrap flush_workqueue()
using a macro") for background.

Changes in v4:
  Use flush_work() instead of introducing a dedicated WQ.

 drivers/rtc/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexandre Belloni June 24, 2022, 5:14 p.m. UTC | #1
On Fri, 10 Jun 2022 19:48:36 +0900, Tetsuo Handa wrote:
> Since "struct rtc_device" is per a device struct, I assume that clear_uie()
> needs to wait for only one work associated with that device. Therefore,
> wait for only that work using flush_work().
> 
> 

Applied, thanks!

[1/1] rtc: Replace flush_scheduled_work() with flush_work().
      commit: ff30b86c76276c2f858744b8bc04b386b4a36c94

Best regards,
diff mbox series

Patch

diff --git a/drivers/rtc/dev.c b/drivers/rtc/dev.c
index 69325aeede1a..5cf90daf975c 100644
--- a/drivers/rtc/dev.c
+++ b/drivers/rtc/dev.c
@@ -96,7 +96,7 @@  static int clear_uie(struct rtc_device *rtc)
 		}
 		if (rtc->uie_task_active) {
 			spin_unlock_irq(&rtc->irq_lock);
-			flush_scheduled_work();
+			flush_work(&rtc->uie_task);
 			spin_lock_irq(&rtc->irq_lock);
 		}
 		rtc->uie_irq_active = 0;