Skip to contentSkip to conversation

pwm: Use of_property_read_bool()

PATCH In review Rob Herring (Arm) 2 participants 4 messages Jul 31, 2024 – Sep 4, 2024 PWM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pwm: Use of_property_read_bool()

Use of_property_read_bool() to read boolean properties rather than of_get_property(). This is part of a larger effort to remove callers of of_get_property() and similar functions. of_get_property() leaks the DT property data pointer which is a problem for dynamically allocated nodes which may be freed.

---
 drivers/pwm/pwm-omap-dmtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/pwm-omap-dmtimer.c +1 -1
index cd51c4a938f5..e514f3614c43 100644
@@ -355,7 +355,7 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
 		goto err_platdata;
 	}
 
-	if (!of_get_property(timer, "ti,timer-pwm", NULL)) {
+	if (!of_property_read_bool(timer, "ti,timer-pwm")) {
 		dev_err(&pdev->dev, "Missing ti,timer-pwm capability\n");
 		ret = -ENODEV;
 		goto err_timer_property;
Signature · 1 line
2.43.0
#1 lore raw

Hello,

Quoted 10 lines · Rob Herring (Arm)

Use of_property_read_bool() to read boolean properties rather than of_get_property(). This is part of a larger effort to remove callers of of_get_property() and similar functions. of_get_property() leaks the DT property data pointer which is a problem for dynamically allocated nodes which may be freed.

---
 drivers/pwm/pwm-omap-dmtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Looks good to me. Unless you object I'd apply with adding "omap-dmtimer: " to the short log.

Best regards
Uwe

#2 lore raw
Quoted 10 lines · Uwe Kleine-König

Hello,

Quoted 6 lines · Rob Herring (Arm)

Use of_property_read_bool() to read boolean properties rather than of_get_property(). This is part of a larger effort to remove callers of of_get_property() and similar functions. of_get_property() leaks the DT property data pointer which is a problem for dynamically allocated nodes which may be freed.

Quoted 7 lines
Quoted 4 lines
---
 drivers/pwm/pwm-omap-dmtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Looks good to me. Unless you object I'd apply with adding "omap-dmtimer: " to the short log.

No objection and sorry I missed that.

Rob

#3 lore raw
Quoted 17 lines · Rob Herring
Quoted 15 lines · Uwe Kleine-König

Hello,

Quoted 10 lines · Rob Herring (Arm)

Use of_property_read_bool() to read boolean properties rather than of_get_property(). This is part of a larger effort to remove callers of of_get_property() and similar functions. of_get_property() leaks the DT property data pointer which is a problem for dynamically allocated nodes which may be freed.

---
 drivers/pwm/pwm-omap-dmtimer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Quoted 2 lines

Looks good to me. Unless you object I'd apply with adding "omap-dmtimer: " to the short log.

No objection and sorry I missed that.

No problem for me, applied with the mentioned change to the short log to
https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next .

Best regards
Uwe