@@ -242,14 +242,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
mtk_v4l2_err("[VPU] vpu device in not ready");
return -EPROBE_DEFER;
}
- if (!pdev->dev.dma_parms) {
- pdev->dev.dma_parms = devm_kzalloc(&pdev->dev,
- sizeof(*pdev->dev.dma_parms),
- GFP_KERNEL);
- if (!pdev->dev.dma_parms)
- return -ENOMEM;
- }
- dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32));
+ dma_set_max_seg_size(&pdev->dev, UINT_MAX);
vpu_wdt_reg_handler(dev->vpu_plat_dev, mtk_vcodec_dec_reset_handler,
dev, VPU_RST_DEC);
@@ -249,14 +249,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
mtk_v4l2_err("[VPU] vpu device in not ready");
return -EPROBE_DEFER;
}
- if (!pdev->dev.dma_parms) {
- pdev->dev.dma_parms = devm_kzalloc(&pdev->dev,
- sizeof(*pdev->dev.dma_parms),
- GFP_KERNEL);
- if (!pdev->dev.dma_parms)
- return -ENOMEM;
- }
- dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32));
+ dma_set_max_seg_size(&pdev->dev, UINT_MAX);
vpu_wdt_reg_handler(dev->vpu_plat_dev, mtk_vcodec_enc_reset_handler,
dev, VPU_RST_ENC);
9495b7e92f71 ("driver core: platform: Initialize dma_parms for platform devices") included dma_parms in platform_device. There's no need to allocate again. Fixes: 13483fc2f20f0e2db7ba9c39b095ac7ea46f8de8 ("media: mtk-vcodec: set dma max segment size") Suggested-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org> --- drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c | 9 +-------- drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-)