Commit be11d67a authored by Rob Herring's avatar Rob Herring Committed by Michal Simek
Browse files

soc: xilinx: 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: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230310144725.1545315-1-robh@kernel.org


Signed-off-by: default avatarMichal Simek <michal.simek@amd.com>
parent ac9a7868
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
	} else if (ret != -EACCES && ret != -ENODEV) {
		dev_err(&pdev->dev, "Failed to Register with Xilinx Event manager %d\n", ret);
		return ret;
	} else if (of_find_property(pdev->dev.of_node, "mboxes", NULL)) {
	} else if (of_property_present(pdev->dev.of_node, "mboxes")) {
		zynqmp_pm_init_suspend_work =
			devm_kzalloc(&pdev->dev,
				     sizeof(struct zynqmp_pm_work_struct),
@@ -240,7 +240,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
			dev_err(&pdev->dev, "Failed to request rx channel\n");
			return PTR_ERR(rx_chan);
		}
	} else if (of_find_property(pdev->dev.of_node, "interrupts", NULL)) {
	} else if (of_property_present(pdev->dev.of_node, "interrupts")) {
		irq = platform_get_irq(pdev, 0);
		if (irq <= 0)
			return -ENXIO;