[linux-next] hte: Use device_match_of_node()

Message ID 202211171517291515920@zte.com.cn
State New
Headers
Series [linux-next] hte: Use device_match_of_node() |

Commit Message

ye.xingchen@zte.com.cn Nov. 17, 2022, 7:17 a.m. UTC
  From: ye xingchen <ye.xingchen@zte.com.cn>

Replace the open-code with device_match_of_node().

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
---
 drivers/hte/hte.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Dipen Patel Nov. 19, 2022, 2:08 a.m. UTC | #1
On 11/16/22 11:17 PM, ye.xingchen@zte.com.cn wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Replace the open-code with device_match_of_node().
> 
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> ---
>  drivers/hte/hte.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hte/hte.c b/drivers/hte/hte.c
> index 7c3b4476f890..5ae81fb31683 100644
> --- a/drivers/hte/hte.c
> +++ b/drivers/hte/hte.c
> @@ -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

Acked-by: Dipen Patel <dipenp@nvidia.com>
  

Patch

diff --git a/drivers/hte/hte.c b/drivers/hte/hte.c
index 7c3b4476f890..5ae81fb31683 100644
--- a/drivers/hte/hte.c
+++ b/drivers/hte/hte.c
@@ -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;
 		}