hwspinlock: Use device_match_of_node()

Message ID 202211251544369078587@zte.com.cn
State New
Headers
Series hwspinlock: Use device_match_of_node() |

Commit Message

ye.xingchen@zte.com.cn Nov. 25, 2022, 7:44 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/hwspinlock/hwspinlock_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Baolin Wang Nov. 25, 2022, 8:18 a.m. UTC | #1
On 11/25/2022 3:44 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>

LGTM.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

> ---
>   drivers/hwspinlock/hwspinlock_core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
> index fd5f5c5a5244..22b8f2a70b3b 100644
> --- a/drivers/hwspinlock/hwspinlock_core.c
> +++ b/drivers/hwspinlock/hwspinlock_core.c
> @@ -367,7 +367,7 @@ int of_hwspin_lock_get_id(struct device_node *np, int index)
>   			continue;
>   		}
> 
> -		if (hwlock->bank->dev->of_node == args.np) {
> +		if (device_match_of_node(hwlock->bank->dev, args.np)) {
>   			ret = 0;
>   			break;
>   		}
  
Philippe Mathieu-Daudé Dec. 14, 2022, 2:15 p.m. UTC | #2
On 25/11/22 08:44, 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/hwspinlock/hwspinlock_core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
  
Bjorn Andersson Dec. 28, 2022, 6:18 p.m. UTC | #3
On Fri, 25 Nov 2022 15:44:36 +0800 (CST), ye.xingchen@zte.com.cn wrote:
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> Replace the open-code with device_match_of_node().
> 
> 

Applied, thanks!

[1/1] hwspinlock: Use device_match_of_node()
      commit: ec5c05e5ac8bcb4a6bcd92970e15494a85400d34

Best regards,
  

Patch

diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
index fd5f5c5a5244..22b8f2a70b3b 100644
--- a/drivers/hwspinlock/hwspinlock_core.c
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -367,7 +367,7 @@  int of_hwspin_lock_get_id(struct device_node *np, int index)
 			continue;
 		}

-		if (hwlock->bank->dev->of_node == args.np) {
+		if (device_match_of_node(hwlock->bank->dev, args.np)) {
 			ret = 0;
 			break;
 		}