From 26c682676471777c8464645695d3590b9134a5e7 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Wed, 29 Mar 2023 10:52:10 -0500 Subject: soc: mediatek: mtk-svs: Add explicit include for cpu.h Removing the include of cpu.h from of_device.h (included by of_platform.h) causes an error: drivers/soc/mediatek/mtk-svs.c:2134:41: error: implicit declaration of function 'get_cpu_device'; did you mean 'get_swap_device'? [-Werror=implicit-function-declaration] of_platform.h is still needed for of_find_device_by_node(). Link: https://lore.kernel.org/r/20230329-dt-cpu-header-cleanups-v1-13-581e2605fe47@kernel.org Signed-off-by: Rob Herring --- drivers/soc/mediatek/mtk-svs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/soc') diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c index f26eb2f637d5..1b7579a5bec6 100644 --- a/drivers/soc/mediatek/mtk-svs.c +++ b/drivers/soc/mediatek/mtk-svs.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From 83f32497890c8f3e5d2337bc4f353442641b6750 Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Fri, 10 Mar 2023 08:47:23 -0600 Subject: soc: fsl: Use of_property_present() for testing DT property presence It is preferred to use typed property access functions (i.e. of_property_read_ 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. Link: https://lore.kernel.org/r/20230310144723.1545069-1-robh@kernel.org Signed-off-by: Rob Herring --- drivers/soc/fsl/qbman/dpaa_sys.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/soc') diff --git a/drivers/soc/fsl/qbman/dpaa_sys.c b/drivers/soc/fsl/qbman/dpaa_sys.c index 9dd8bb571dbc..33751450047e 100644 --- a/drivers/soc/fsl/qbman/dpaa_sys.c +++ b/drivers/soc/fsl/qbman/dpaa_sys.c @@ -39,8 +39,7 @@ int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr, { struct device_node *mem_node; struct reserved_mem *rmem; - struct property *prop; - int len, err; + int err; __be32 *res_array; mem_node = of_parse_phandle(dev->of_node, "memory-region", idx); @@ -63,8 +62,9 @@ int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr, * This is needed because QBMan HW does not allow the base address/ * size to be modified once set. */ - prop = of_find_property(mem_node, "reg", &len); - if (!prop) { + if (!of_property_present(mem_node, "reg")) { + struct property *prop; + prop = devm_kzalloc(dev, sizeof(*prop), GFP_KERNEL); if (!prop) return -ENOMEM; -- cgit v1.2.3