@@ -1040,36 +1040,30 @@ static unsigned int cpr_get_fuse_corner(struct dev_pm_opp *opp)
1040
1040
static unsigned long cpr_get_opp_hz_for_req (struct dev_pm_opp * ref ,
1041
1041
struct device * cpu_dev )
1042
1042
{
1043
- u64 rate = 0 ;
1044
- struct device_node * ref_np ;
1045
- struct device_node * desc_np ;
1046
- struct device_node * child_np = NULL ;
1047
- struct device_node * child_req_np = NULL ;
1043
+ struct device_node * ref_np __free (device_node ) = NULL ;
1044
+ struct device_node * desc_np __free (device_node ) =
1045
+ dev_pm_opp_of_get_opp_desc_node (cpu_dev );
1048
1046
1049
- desc_np = dev_pm_opp_of_get_opp_desc_node (cpu_dev );
1050
1047
if (!desc_np )
1051
1048
return 0 ;
1052
1049
1053
1050
ref_np = dev_pm_opp_get_of_node (ref );
1054
1051
if (!ref_np )
1055
- goto out_ref ;
1052
+ return 0 ;
1053
+
1054
+ for_each_available_child_of_node_scoped (desc_np , child_np ) {
1055
+ struct device_node * child_req_np __free (device_node ) =
1056
+ of_parse_phandle (child_np , "required-opps" , 0 );
1056
1057
1057
- for_each_available_child_of_node (desc_np , child_np ) {
1058
- of_node_put (child_req_np );
1059
- child_req_np = of_parse_phandle (child_np , "required-opps" , 0 );
1060
1058
if (child_req_np == ref_np ) {
1059
+ u64 rate ;
1060
+
1061
1061
of_property_read_u64 (child_np , "opp-hz" , & rate );
1062
- break ;
1062
+ return ( unsigned long ) rate ;
1063
1063
}
1064
1064
}
1065
1065
1066
- of_node_put (child_req_np );
1067
- of_node_put (child_np );
1068
- of_node_put (ref_np );
1069
- out_ref :
1070
- of_node_put (desc_np );
1071
-
1072
- return (unsigned long ) rate ;
1066
+ return 0 ;
1073
1067
}
1074
1068
1075
1069
static int cpr_corner_init (struct cpr_drv * drv )
0 commit comments