public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] scsi: ufs: ufshcd-pltfrm: Use of_property_present()
@ 2024-08-08 17:06 Rob Herring (Arm)
  2024-08-08 17:09 ` Bart Van Assche
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rob Herring (Arm) @ 2024-08-08 17:06 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen
  Cc: Bart Van Assche, linux-scsi, linux-kernel

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>
---
v2:
 - Update subject to include 'ufshcd-pltfrm'
---
 drivers/ufs/host/ufshcd-pltfrm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c
index a3e69ecafd27..2e1eb898a27c 100644
--- a/drivers/ufs/host/ufshcd-pltfrm.c
+++ b/drivers/ufs/host/ufshcd-pltfrm.c
@@ -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;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] scsi: ufs: ufshcd-pltfrm: Use of_property_present()
  2024-08-08 17:06 [PATCH v2] scsi: ufs: ufshcd-pltfrm: Use of_property_present() Rob Herring (Arm)
@ 2024-08-08 17:09 ` Bart Van Assche
  2024-08-12 22:17 ` Martin K. Petersen
  2024-08-17  1:38 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Bart Van Assche @ 2024-08-08 17:09 UTC (permalink / raw)
  To: Rob Herring (Arm), James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel

On 8/8/24 10:06 AM, Rob Herring (Arm) wrote:
> 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.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] scsi: ufs: ufshcd-pltfrm: Use of_property_present()
  2024-08-08 17:06 [PATCH v2] scsi: ufs: ufshcd-pltfrm: Use of_property_present() Rob Herring (Arm)
  2024-08-08 17:09 ` Bart Van Assche
@ 2024-08-12 22:17 ` Martin K. Petersen
  2024-08-17  1:38 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2024-08-12 22:17 UTC (permalink / raw)
  To: Rob Herring (Arm)
  Cc: James E.J. Bottomley, Martin K. Petersen, Bart Van Assche,
	linux-scsi, linux-kernel


Rob,

> 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!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] scsi: ufs: ufshcd-pltfrm: Use of_property_present()
  2024-08-08 17:06 [PATCH v2] scsi: ufs: ufshcd-pltfrm: Use of_property_present() Rob Herring (Arm)
  2024-08-08 17:09 ` Bart Van Assche
  2024-08-12 22:17 ` Martin K. Petersen
@ 2024-08-17  1:38 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2024-08-17  1:38 UTC (permalink / raw)
  To: James E.J. Bottomley, Rob Herring (Arm)
  Cc: Martin K . Petersen, Bart Van Assche, linux-scsi, linux-kernel

On Thu, 08 Aug 2024 11:06:44 -0600, Rob Herring (Arm) wrote:

> 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

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-08-17  1:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-08 17:06 [PATCH v2] scsi: ufs: ufshcd-pltfrm: Use of_property_present() Rob Herring (Arm)
2024-08-08 17:09 ` Bart Van Assche
2024-08-12 22:17 ` Martin K. Petersen
2024-08-17  1:38 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox