]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: ufs: ufshcd-pltfrm: Use of_property_present()
authorRob Herring (Arm) <robh@kernel.org>
Thu, 8 Aug 2024 17:06:44 +0000 (11:06 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 12 Aug 2024 22:16:40 +0000 (18:16 -0400)
Use of_property_present() to test for property presence rather than
of_find_property(). This is part of a larger effort to remove callers of
of_find_property() and similar functions. of_find_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/20240808170644.1436991-1-robh@kernel.org
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/host/ufshcd-pltfrm.c

index a3e69ecafd2750f6674929f6843b840c8bc49fe4..2e1eb898a27c51e4689b04432dab658e121190b9 100644 (file)
@@ -272,10 +272,10 @@ static int ufshcd_parse_operating_points(struct ufs_hba *hba)
        const char **clk_names;
        int cnt, i, ret;
 
-       if (!of_find_property(np, "operating-points-v2", NULL))
+       if (!of_property_present(np, "operating-points-v2"))
                return 0;
 
-       if (of_find_property(np, "freq-table-hz", NULL)) {
+       if (of_property_present(np, "freq-table-hz")) {
                dev_err(dev, "%s: operating-points and freq-table-hz are incompatible\n",
                         __func__);
                return -EINVAL;