]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
soc: ti: knav: Drop unnecessary check for property presence
authorRob Herring (Arm) <robh@kernel.org>
Wed, 31 Jul 2024 20:13:57 +0000 (14:13 -0600)
committerNishanth Menon <nm@ti.com>
Tue, 6 Aug 2024 21:29:04 +0000 (16:29 -0500)
of_property_read_u32() returns -EINVAL if a property is not present, so
the preceding check for presence with of_get_property() can be
dropped.

This is part of a larger effort to remove callers of of_get_property()
and similar functions. of_get_property() leaks the DT struct property
and data pointers which is a problem for dynamically allocated nodes
which may be freed.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20240731201407.1838385-2-robh@kernel.org
Signed-off-by: Nishanth Menon <nm@ti.com>
drivers/soc/ti/knav_qmss_queue.c

index f2055a76f84c2bdb71d962c0d9597fc65981befc..a15eaa1900ab08f0ce3d9a2c81e4e9269e024d4a 100644 (file)
@@ -1104,11 +1104,6 @@ static int knav_queue_setup_regions(struct knav_device *kdev,
                        continue;
                }
 
-               if (!of_get_property(child, "link-index", NULL)) {
-                       dev_err(dev, "No link info for %s\n", region->name);
-                       devm_kfree(dev, region);
-                       continue;
-               }
                ret = of_property_read_u32(child, "link-index",
                                           &region->link_index);
                if (ret) {