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>
        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);
 
                }
        }
 
-       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");
 
                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);
 
        struct xvtc_device *found = NULL;
        struct xvtc_device *xvtc;
 
-       if (!of_find_property(np, "xlnx,vtc", NULL))
+       if (!of_property_present(np, "xlnx,vtc"))
                return NULL;
 
        xvtc_node = of_parse_phandle(np, "xlnx,vtc", 0);