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.
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Liu Ying <victor.liu@nxp.com> # i.MX bridge
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20230310144705.1542207-1-robh@kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
}
/* specially select the next bridge with companion PXL2DPI */
- if (of_find_property(remote, "fsl,companion-pxl2dpi", NULL))
+ if (of_property_present(remote, "fsl,companion-pxl2dpi"))
bridge_sel = ep_cnt;
ep_cnt++;
for_each_available_child_of_node(host->dev->of_node, node) {
/* skip nodes without reg property */
- if (!of_find_property(node, "reg", NULL))
+ if (!of_property_present(node, "reg"))
continue;
of_mipi_dsi_device_add(host, node);
}
gpu->fast_rate = 0;
/* You down with OPP? */
- if (!of_find_property(dev->of_node, "operating-points-v2", NULL))
+ if (!of_property_present(dev->of_node, "operating-points-v2"))
ret = adreno_get_legacy_pwrlevels(dev);
else {
ret = devm_pm_opp_of_add_table(dev);
dev_set_drvdata(dev, backend);
spin_lock_init(&backend->frontend_lock);
- if (of_find_property(dev->of_node, "interconnects", NULL)) {
+ if (of_property_present(dev->of_node, "interconnects")) {
/*
* This assume we have the same DMA constraints for all our the
* devices in our pipeline (all the backends, but also the
mixer->engine.ops = &sun8i_engine_ops;
mixer->engine.node = dev->of_node;
- if (of_find_property(dev->of_node, "iommus", NULL)) {
+ if (of_property_present(dev->of_node, "iommus")) {
/*
* This assume we have the same DMA constraints for
* all our the mixers in our pipeline. This sounds
if (err)
return ERR_PTR(err);
- if (of_get_property(of_node, "reg", NULL))
+ if (of_property_present(of_node, "reg"))
drm_warn(dev, "preferring \"memory-region\" over \"reg\" property\n");
return res;
struct device *dev = &pdev->dev;
int ret;
- if (!of_find_property(dev->of_node, "interrupts", NULL)) {
+ if (!of_property_present(dev->of_node, "interrupts")) {
dev_warn(dev, "'interrupts' DT property is missing, no CEC\n");
return 0;
}