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.

of: Use preferred of_property_read_* functions

Replace instances of of_get_property/of_find_property() with appropriate
typed of_property_read_*() functions.

Link: https://lore.kernel.org/all/20230215215502.690716-1-robh@kernel.org/
Signed-off-by: Rob Herring <robh@kernel.org>

+2 -5
+1 -4
drivers/of/platform.c
··· 222 222 struct device *parent) 223 223 { 224 224 struct amba_device *dev; 225 - const void *prop; 226 225 int ret; 227 226 228 227 pr_debug("Creating amba device %pOF\n", node); ··· 249 250 of_device_make_bus_id(&dev->dev); 250 251 251 252 /* Allow the HW Peripheral ID to be overridden */ 252 - prop = of_get_property(node, "arm,primecell-periphid", NULL); 253 - if (prop) 254 - dev->periphid = of_read_ulong(prop, 1); 253 + of_property_read_u32(node, "arm,primecell-periphid", &dev->periphid); 255 254 256 255 ret = of_address_to_resource(node, 0, &dev->res); 257 256 if (ret) {
+1 -1
drivers/of/property.c
··· 1358 1358 * Ignore node with gpio-hog property since its gpios are all provided 1359 1359 * by its parent. 1360 1360 */ 1361 - if (of_find_property(np, "gpio-hog", NULL)) 1361 + if (of_property_read_bool(np, "gpio-hog")) 1362 1362 return NULL; 1363 1363 1364 1364 if (of_parse_phandle_with_args(np, prop_name, "#gpio-cells", index,