Commit ec79ed5e authored by Rob Herring's avatar Rob Herring Committed by Arnd Bergmann

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_<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>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 908ce5c0
...@@ -39,8 +39,7 @@ int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr, ...@@ -39,8 +39,7 @@ int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr,
{ {
struct device_node *mem_node; struct device_node *mem_node;
struct reserved_mem *rmem; struct reserved_mem *rmem;
struct property *prop; int err;
int len, err;
__be32 *res_array; __be32 *res_array;
mem_node = of_parse_phandle(dev->of_node, "memory-region", idx); 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, ...@@ -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/ * This is needed because QBMan HW does not allow the base address/
* size to be modified once set. * size to be modified once set.
*/ */
prop = of_find_property(mem_node, "reg", &len); if (!of_property_present(mem_node, "reg")) {
if (!prop) { struct property *prop;
prop = devm_kzalloc(dev, sizeof(*prop), GFP_KERNEL); prop = devm_kzalloc(dev, sizeof(*prop), GFP_KERNEL);
if (!prop) if (!prop)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment