Skip to contentSkip to conversation

hte: Use device_match_of_node()

PATCH In review [email protected] 2 participants 2 messages Nov 17, 2022 – Nov 19, 2022 HTE

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hte: Use device_match_of_node()

From: ye xingchen <[email protected]>

Replace the open-code with device_match_of_node().

---
 drivers/hte/hte.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hte/hte.c +1 -1
index 7c3b4476f890..5ae81fb31683 100644
@@ -444,7 +444,7 @@ static struct hte_device *of_node_to_htedevice(struct device_node *np)
 
 	list_for_each_entry(gdev, &hte_devices, list)
 		if (gdev->chip && gdev->chip->dev &&
-		    gdev->chip->dev->of_node == np) {
+		    device_match_of_node(gdev->chip->dev, np)) {
 			spin_unlock(&hte_lock);
 			return gdev;
 		}
Signature · 1 line
2.25.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines · On 11/16/22 11:17 PM, [email protected] wrote:

From: ye xingchen <[email protected]>

Replace the open-code with device_match_of_node().

---
 drivers/hte/hte.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hte/hte.c +0 -0
index 7c3b4476f890..5ae81fb31683 100644

drivers/hte/hte.c static struct hte_device *of_node_to_htedevice(struct device_node *np) · line 450

Quoted 8 lines
drivers/hte/hte.c +1 -1
@@ -444,7 +444,7 @@ static struct hte_device *of_node_to_htedevice(struct device_node *np)
 
 	list_for_each_entry(gdev, &hte_devices, list)
 		if (gdev->chip && gdev->chip->dev &&
-		    gdev->chip->dev->of_node == np) {
+		    device_match_of_node(gdev->chip->dev, np)) {
 			spin_unlock(&hte_lock);
 			return gdev;
 		}

Will pull changes to hte tree...thanks