diff mbox series

PM / devfreq: event: Use device_match_of_node()

Message ID 202211251510047017670@zte.com.cn (mailing list archive)
State Accepted
Delegated to: Chanwoo Choi
Headers show
Series PM / devfreq: event: Use device_match_of_node() | expand

Commit Message

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

Comments

Chanwoo Choi Dec. 2, 2022, 11:05 p.m. UTC | #1
On 22. 11. 25. 16:10, 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/devfreq/devfreq-event.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
> index 6765c03334bc..f041edccd107 100644
> --- a/drivers/devfreq/devfreq-event.c
> +++ b/drivers/devfreq/devfreq-event.c
> @@ -233,7 +233,7 @@ struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev,
> 
>  	mutex_lock(&devfreq_event_list_lock);
>  	list_for_each_entry(edev, &devfreq_event_list, node) {
> -		if (edev->dev.parent && edev->dev.parent->of_node == node)
> +		if (edev->dev.parent && device_match_of_node(edev->dev.parent, node))
>  			goto out;
>  	}
> 

Applied it.
diff mbox series

Patch

diff --git a/drivers/devfreq/devfreq-event.c b/drivers/devfreq/devfreq-event.c
index 6765c03334bc..f041edccd107 100644
--- a/drivers/devfreq/devfreq-event.c
+++ b/drivers/devfreq/devfreq-event.c
@@ -233,7 +233,7 @@  struct devfreq_event_dev *devfreq_event_get_edev_by_phandle(struct device *dev,

 	mutex_lock(&devfreq_event_list_lock);
 	list_for_each_entry(edev, &devfreq_event_list, node) {
-		if (edev->dev.parent && edev->dev.parent->of_node == node)
+		if (edev->dev.parent && device_match_of_node(edev->dev.parent, node))
 			goto out;
 	}