Skip to content

Commit be11d67

Browse files
robherringmichalsimek
authored andcommitted
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: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230310144725.1545315-1-robh@kernel.org Signed-off-by: Michal Simek <michal.simek@amd.com>
1 parent ac9a786 commit be11d67

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/soc/xilinx/zynqmp_power.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
218218
} else if (ret != -EACCES && ret != -ENODEV) {
219219
dev_err(&pdev->dev, "Failed to Register with Xilinx Event manager %d\n", ret);
220220
return ret;
221-
} else if (of_find_property(pdev->dev.of_node, "mboxes", NULL)) {
221+
} else if (of_property_present(pdev->dev.of_node, "mboxes")) {
222222
zynqmp_pm_init_suspend_work =
223223
devm_kzalloc(&pdev->dev,
224224
sizeof(struct zynqmp_pm_work_struct),
@@ -240,7 +240,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
240240
dev_err(&pdev->dev, "Failed to request rx channel\n");
241241
return PTR_ERR(rx_chan);
242242
}
243-
} else if (of_find_property(pdev->dev.of_node, "interrupts", NULL)) {
243+
} else if (of_property_present(pdev->dev.of_node, "interrupts")) {
244244
irq = platform_get_irq(pdev, 0);
245245
if (irq <= 0)
246246
return -ENXIO;

0 commit comments

Comments
 (0)