Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mfd: various: 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>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230310144712.1543379-1-robh@kernel.org

authored by

Rob Herring and committed by
Lee Jones
1ba58fbb 2ddbddaf

+3 -3
+1 -1
drivers/mfd/bcm2835-pm.c
··· 28 28 static int bcm2835_pm_get_pdata(struct platform_device *pdev, 29 29 struct bcm2835_pm *pm) 30 30 { 31 - if (of_find_property(pm->dev->of_node, "reg-names", NULL)) { 31 + if (of_property_present(pm->dev->of_node, "reg-names")) { 32 32 struct resource *res; 33 33 34 34 pm->base = devm_platform_ioremap_resource_byname(pdev, "pm");
+1 -1
drivers/mfd/khadas-mcu.c
··· 112 112 if (ret) 113 113 return ret; 114 114 115 - if (of_find_property(dev->of_node, "#cooling-cells", NULL)) 115 + if (of_property_present(dev->of_node, "#cooling-cells")) 116 116 return devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE, 117 117 khadas_mcu_fan_cells, 118 118 ARRAY_SIZE(khadas_mcu_fan_cells),
+1 -1
drivers/mfd/stmpe.c
··· 1378 1378 1379 1379 stmpe_of_probe(pdata, np); 1380 1380 1381 - if (of_find_property(np, "interrupts", NULL) == NULL) 1381 + if (!of_property_present(np, "interrupts")) 1382 1382 ci->irq = -1; 1383 1383 1384 1384 stmpe = devm_kzalloc(ci->dev, sizeof(struct stmpe), GFP_KERNEL);