Commit 6a7a883f authored by kyrie wu's avatar kyrie wu Committed by Mauro Carvalho Chehab

media: mtk-jpeg: Remove some unnecessary variables

remove is_jpgenc_multihw, is_jpgdec_multihw,
and unnecessary initialization.
Signed-off-by: default avatarkyrie wu <kyrie.wu@mediatek.com>
Signed-off-by: default avatarirui wang <irui.wang@mediatek.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent d40e9527
......@@ -204,12 +204,10 @@ struct mtk_jpegdec_comp_dev {
* @variant: driver variant to be used
* @reg_encbase: jpg encode register base addr
* @enc_hw_dev: jpg encode hardware device
* @is_jpgenc_multihw: the flag of multi-hw core
* @enc_hw_wq: jpg encode wait queue
* @enchw_rdy: jpg encode hw ready flag
* @reg_decbase: jpg decode register base addr
* @dec_hw_dev: jpg decode hardware device
* @is_jpgdec_multihw: the flag of dec multi-hw core
* @dec_hw_wq: jpg decode wait queue
* @dec_workqueue: jpg decode work queue
* @dechw_rdy: jpg decode hw ready flag
......@@ -229,13 +227,11 @@ struct mtk_jpeg_dev {
void __iomem *reg_encbase[MTK_JPEGENC_HW_MAX];
struct mtk_jpegenc_comp_dev *enc_hw_dev[MTK_JPEGENC_HW_MAX];
bool is_jpgenc_multihw;
wait_queue_head_t enc_hw_wq;
atomic_t enchw_rdy;
void __iomem *reg_decbase[MTK_JPEGDEC_HW_MAX];
struct mtk_jpegdec_comp_dev *dec_hw_dev[MTK_JPEGDEC_HW_MAX];
bool is_jpgdec_multihw;
wait_queue_head_t dec_hw_wq;
struct workqueue_struct *dec_workqueue;
atomic_t dechw_rdy;
......
......@@ -608,11 +608,6 @@ static int mtk_jpegdec_hw_probe(struct platform_device *pdev)
dev->plat_dev = pdev;
dev->dev = &pdev->dev;
if (!master_dev->is_jpgdec_multihw) {
master_dev->is_jpgdec_multihw = true;
for (i = 0; i < MTK_JPEGDEC_HW_MAX; i++)
master_dev->dec_hw_dev[i] = NULL;
init_waitqueue_head(&master_dev->dec_hw_wq);
master_dev->workqueue = alloc_ordered_workqueue(MTK_JPEG_NAME,
WQ_MEM_RECLAIM
......@@ -620,11 +615,11 @@ static int mtk_jpegdec_hw_probe(struct platform_device *pdev)
if (!master_dev->workqueue)
return -EINVAL;
ret = devm_add_action_or_reset(&pdev->dev, mtk_jpegdec_destroy_workqueue,
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);
spin_lock_init(&dev->hw_lock);
......
......@@ -340,18 +340,12 @@ static int mtk_jpegenc_hw_probe(struct platform_device *pdev)
dev->plat_dev = pdev;
dev->dev = &pdev->dev;
if (!master_dev->is_jpgenc_multihw) {
master_dev->is_jpgenc_multihw = true;
for (i = 0; i < MTK_JPEGENC_HW_MAX; i++)
master_dev->enc_hw_dev[i] = NULL;
init_waitqueue_head(&master_dev->enc_hw_wq);
master_dev->workqueue = alloc_ordered_workqueue(MTK_JPEG_NAME,
WQ_MEM_RECLAIM
| WQ_FREEZABLE);
if (!master_dev->workqueue)
return -EINVAL;
}
atomic_set(&master_dev->enchw_rdy, MTK_JPEGENC_HW_MAX);
spin_lock_init(&dev->hw_lock);
......
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