Skip to contentSkip to conversation

scsi: ufs: ufshcd-pltfrm: Use of_property_present()

PATCH Applied Rob Herring (Arm) 3 participants 4 messages Aug 8, 2024 – Aug 17, 2024 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 scsi: ufs: ufshcd-pltfrm: Use of_property_present()

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.

---
v2:
- Update subject to include 'ufshcd-pltfrm'

---
 drivers/ufs/host/ufshcd-pltfrm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/ufs/host/ufshcd-pltfrm.c +2 -2
index a3e69ecafd27..2e1eb898a27c 100644
@@ -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;
Signature · 1 line
2.43.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 5 lines · Rob Herring (Arm)

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.

#2 lore raw
In reply to Rob Herring (Arm)

Rob,

Quoted 5 lines

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.

Applied to 6.12/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#3 lore raw
In reply to Rob Herring (Arm)
Quoted 8 lines · Rob Herring (Arm)

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.

[...]

Applied to 6.12/scsi-queue, thanks!

[1/1] scsi: ufs: ufshcd-pltfrm: Use of_property_present()

      https://git.kernel.org/mkp/scsi/c/fd9cb9615fca
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering