Commit ba7c0d34 authored by Yang Yingliang's avatar Yang Yingliang Committed by Mauro Carvalho Chehab

media: mtk-jpegdec: add missing destroy_workqueue()

destroy_workqueue() needs be called to when driver is
unloading, fix it by using devm_add_action_or_reset()
to make workqueuedevice-managed.

Fixes: dedc2150 ("media: mtk-jpegdec: add jpeg decode worker interface")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent def4d258
...@@ -580,6 +580,11 @@ static int mtk_jpegdec_hw_init_irq(struct mtk_jpegdec_comp_dev *dev) ...@@ -580,6 +580,11 @@ static int mtk_jpegdec_hw_init_irq(struct mtk_jpegdec_comp_dev *dev)
return 0; return 0;
} }
static void mtk_jpegdec_destroy_workqueue(void *data)
{
destroy_workqueue(data);
}
static int mtk_jpegdec_hw_probe(struct platform_device *pdev) static int mtk_jpegdec_hw_probe(struct platform_device *pdev)
{ {
struct mtk_jpegdec_clk *jpegdec_clk; struct mtk_jpegdec_clk *jpegdec_clk;
...@@ -614,6 +619,11 @@ static int mtk_jpegdec_hw_probe(struct platform_device *pdev) ...@@ -614,6 +619,11 @@ static int mtk_jpegdec_hw_probe(struct platform_device *pdev)
| WQ_FREEZABLE); | WQ_FREEZABLE);
if (!master_dev->workqueue) if (!master_dev->workqueue)
return -EINVAL; return -EINVAL;
ret = devm_add_action_or_reset(&pdev->dev, mtk_jpegdec_destroy_workqueue,
master_dev->workqueue);
if (ret)
return ret;
} }
atomic_set(&master_dev->dechw_rdy, MTK_JPEGDEC_HW_MAX); atomic_set(&master_dev->dechw_rdy, MTK_JPEGDEC_HW_MAX);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment