summaryrefslogtreecommitdiff
path: root/drivers/media/platform/mediatek
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-03-10 17:47:11 +0300
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-04-11 19:54:01 +0300
commit0f4afd529224aec36cc6d01d08ac7d5e92fb217c (patch)
tree31d0e4db10d618d1829db582fe81acc6f675cc60 /drivers/media/platform/mediatek
parent567f97bd381fd79fa8563808118fc757cb6fa4ff (diff)
downloadlinux-0f4afd529224aec36cc6d01d08ac7d5e92fb217c.tar.xz
media: Use of_property_present() for testing DT property presence
It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. As part of this, convert of_get_property/of_find_property calls to the recently added of_property_present() helper when we just want to test for presence of a property and nothing more. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/platform/mediatek')
-rw-r--r--drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c2
-rw-r--r--drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c2
-rw-r--r--drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
index 201280132358..6c7c5f3648df 100644
--- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
@@ -1782,7 +1782,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
jpeg->vdev->device_caps = V4L2_CAP_STREAMING |
V4L2_CAP_VIDEO_M2M_MPLANE;
- if (of_get_property(pdev->dev.of_node, "dma-ranges", NULL))
+ if (of_property_present(pdev->dev.of_node, "dma-ranges"))
dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(34));
ret = video_register_device(jpeg->vdev, VFL_TYPE_VIDEO, -1);
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
index 2fa5c5e6607c..3755acc61d7d 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c
@@ -321,7 +321,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
}
}
- if (of_get_property(pdev->dev.of_node, "dma-ranges", NULL)) {
+ if (of_property_present(pdev->dev.of_node, "dma-ranges")) {
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(34));
if (ret) {
mtk_v4l2_err("Failed to set mask");
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c
index cd0d5da8195a..997108da687c 100644
--- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c
+++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_enc_drv.c
@@ -344,7 +344,7 @@ static int mtk_vcodec_probe(struct platform_device *pdev)
goto err_event_workq;
}
- if (of_get_property(pdev->dev.of_node, "dma-ranges", NULL))
+ if (of_property_present(pdev->dev.of_node, "dma-ranges"))
dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(34));
ret = video_register_device(vfd_enc, VFL_TYPE_VIDEO, -1);