Skip to content

Commit ec79ed5

Browse files
robherringarndb
authored andcommitted
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: Rob Herring <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
1 parent 908ce5c commit ec79ed5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/soc/fsl/qbman/dpaa_sys.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr,
3939
{
4040
struct device_node *mem_node;
4141
struct reserved_mem *rmem;
42-
struct property *prop;
43-
int len, err;
42+
int err;
4443
__be32 *res_array;
4544

4645
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,
6362
* This is needed because QBMan HW does not allow the base address/
6463
* size to be modified once set.
6564
*/
66-
prop = of_find_property(mem_node, "reg", &len);
67-
if (!prop) {
65+
if (!of_property_present(mem_node, "reg")) {
66+
struct property *prop;
67+
6868
prop = devm_kzalloc(dev, sizeof(*prop), GFP_KERNEL);
6969
if (!prop)
7070
return -ENOMEM;

0 commit comments

Comments
 (0)