Skip to contentSkip to conversation

PM / devfreq: Use device_match_of_node()

PATCH In review [email protected] 2 participants 2 messages Nov 25, 2022 – Dec 2, 2022 Device frequency (devfreq)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM / devfreq: Use device_match_of_node()

From: ye xingchen <[email protected]>

Replace the open-code with device_match_of_node().

---
 drivers/devfreq/devfreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/devfreq/devfreq.c +1 -1
index 8c5f6f7fca11..817c71da391a 100644
@@ -1057,7 +1057,7 @@ struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node)
 	mutex_lock(&devfreq_list_lock);
 	list_for_each_entry(devfreq, &devfreq_list, node) {
 		if (devfreq->dev.parent
-			&& devfreq->dev.parent->of_node == node) {
+			&& device_match_of_node(devfreq->dev.parent, node)) {
 			mutex_unlock(&devfreq_list_lock);
 			return devfreq;
 		}
Signature · 1 line
2.25.1
#1 lore raw
Quoted 14 lines · On 22. 11. 25. 16:16, [email protected] wrote:

From: ye xingchen <[email protected]>

Replace the open-code with device_match_of_node().

---
 drivers/devfreq/devfreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/devfreq/devfreq.c +0 -0
index 8c5f6f7fca11..817c71da391a 100644

drivers/devfreq/devfreq.c struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node) · line 1063

Quoted 8 lines
drivers/devfreq/devfreq.c +1 -1
@@ -1057,7 +1057,7 @@ struct devfreq *devfreq_get_devfreq_by_node(struct device_node *node)
 	mutex_lock(&devfreq_list_lock);
 	list_for_each_entry(devfreq, &devfreq_list, node) {
 		if (devfreq->dev.parent
-			&& devfreq->dev.parent->of_node == node) {
+			&& device_match_of_node(devfreq->dev.parent, node)) {
 			mutex_unlock(&devfreq_list_lock);
 			return devfreq;
 		}

Applied it.

Signature · 3 lines
Best Regards,
Samsung Electronics
Chanwoo Choi