[PATCH] extcon: adc-jack: cancel delayed work on remove

Hongyan Xu posted 1 patch 5 days, 12 hours ago
drivers/extcon/extcon-adc-jack.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] extcon: adc-jack: cancel delayed work on remove
Posted by Hongyan Xu 5 days, 12 hours ago
The IRQ handler queues handler as delayed work. The remove callback
passes its embedded work_struct to cancel_work_sync(), which cannot
cancel a pending delayed-work timer.

Free the IRQ to stop new queueing, then cancel the delayed work itself
before devres releases the containing object.

Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
---
 drivers/extcon/extcon-adc-jack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c
index 0317b61..25ee38d 100644
--- a/drivers/extcon/extcon-adc-jack.c
+++ b/drivers/extcon/extcon-adc-jack.c
@@ -163,7 +163,7 @@ static int adc_jack_remove(struct platform_device *pdev)
 	struct adc_jack_data *data = platform_get_drvdata(pdev);
 
 	free_irq(data->irq, data);
-	cancel_work_sync(&data->handler.work);
+	cancel_delayed_work_sync(&data->handler);
 
 	return 0;
 }
-- 
2.50.1.windows.1