@@ -392,11 +392,11 @@ static int mlxsw_thermal_module_bind(struct thermal_zone_device *tzdev,
392
392
trip -> min_state ,
393
393
THERMAL_WEIGHT_DEFAULT );
394
394
if (err < 0 )
395
- goto err_bind_cooling_device ;
395
+ goto err_thermal_zone_bind_cooling_device ;
396
396
}
397
397
return 0 ;
398
398
399
- err_bind_cooling_device :
399
+ err_thermal_zone_bind_cooling_device :
400
400
for (j = i - 1 ; j >= 0 ; j -- )
401
401
thermal_zone_unbind_cooling_device (tzdev , j , cdev );
402
402
return err ;
@@ -766,7 +766,7 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core,
766
766
for (i = 0 ; i < thermal -> tz_module_num ; i ++ ) {
767
767
err = mlxsw_thermal_module_init (dev , core , thermal , i );
768
768
if (err )
769
- goto err_unreg_tz_module_arr ;
769
+ goto err_thermal_module_init ;
770
770
}
771
771
772
772
for (i = 0 ; i < thermal -> tz_module_num ; i ++ ) {
@@ -775,12 +775,13 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core,
775
775
continue ;
776
776
err = mlxsw_thermal_module_tz_init (module_tz );
777
777
if (err )
778
- goto err_unreg_tz_module_arr ;
778
+ goto err_thermal_module_tz_init ;
779
779
}
780
780
781
781
return 0 ;
782
782
783
- err_unreg_tz_module_arr :
783
+ err_thermal_module_tz_init :
784
+ err_thermal_module_init :
784
785
for (i = thermal -> tz_module_num - 1 ; i >= 0 ; i -- )
785
786
mlxsw_thermal_module_fini (& thermal -> tz_module_arr [i ]);
786
787
kfree (thermal -> tz_module_arr );
@@ -871,12 +872,12 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core,
871
872
gearbox_tz -> parent = thermal ;
872
873
err = mlxsw_thermal_gearbox_tz_init (gearbox_tz );
873
874
if (err )
874
- goto err_unreg_tz_gearbox ;
875
+ goto err_thermal_gearbox_tz_init ;
875
876
}
876
877
877
878
return 0 ;
878
879
879
- err_unreg_tz_gearbox :
880
+ err_thermal_gearbox_tz_init :
880
881
for (i -- ; i >= 0 ; i -- )
881
882
mlxsw_thermal_gearbox_tz_fini (& thermal -> tz_gearbox_arr [i ]);
882
883
kfree (thermal -> tz_gearbox_arr );
@@ -920,7 +921,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core,
920
921
err = mlxsw_reg_query (thermal -> core , MLXSW_REG (mfcr ), mfcr_pl );
921
922
if (err ) {
922
923
dev_err (dev , "Failed to probe PWMs\n" );
923
- goto err_free_thermal ;
924
+ goto err_reg_query ;
924
925
}
925
926
mlxsw_reg_mfcr_unpack (mfcr_pl , & freq , & tacho_active , & pwm_active );
926
927
@@ -934,14 +935,14 @@ int mlxsw_thermal_init(struct mlxsw_core *core,
934
935
err = mlxsw_reg_query (thermal -> core , MLXSW_REG (mfsl ),
935
936
mfsl_pl );
936
937
if (err )
937
- goto err_free_thermal ;
938
+ goto err_reg_query ;
938
939
939
940
/* set the minimal RPMs to 0 */
940
941
mlxsw_reg_mfsl_tach_min_set (mfsl_pl , 0 );
941
942
err = mlxsw_reg_write (thermal -> core , MLXSW_REG (mfsl ),
942
943
mfsl_pl );
943
944
if (err )
944
- goto err_free_thermal ;
945
+ goto err_reg_write ;
945
946
}
946
947
}
947
948
for (i = 0 ; i < MLXSW_MFCR_PWMS_MAX ; i ++ ) {
@@ -954,7 +955,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core,
954
955
if (IS_ERR (cdev )) {
955
956
err = PTR_ERR (cdev );
956
957
dev_err (dev , "Failed to register cooling device\n" );
957
- goto err_unreg_cdevs ;
958
+ goto err_thermal_cooling_device_register ;
958
959
}
959
960
thermal -> cdevs [i ] = cdev ;
960
961
}
@@ -978,38 +979,40 @@ int mlxsw_thermal_init(struct mlxsw_core *core,
978
979
if (IS_ERR (thermal -> tzdev )) {
979
980
err = PTR_ERR (thermal -> tzdev );
980
981
dev_err (dev , "Failed to register thermal zone\n" );
981
- goto err_unreg_cdevs ;
982
+ goto err_thermal_zone_device_register ;
982
983
}
983
984
984
985
err = mlxsw_thermal_modules_init (dev , core , thermal );
985
986
if (err )
986
- goto err_unreg_tzdev ;
987
+ goto err_thermal_modules_init ;
987
988
988
989
err = mlxsw_thermal_gearboxes_init (dev , core , thermal );
989
990
if (err )
990
- goto err_unreg_modules_tzdev ;
991
+ goto err_thermal_gearboxes_init ;
991
992
992
993
err = thermal_zone_device_enable (thermal -> tzdev );
993
994
if (err )
994
- goto err_unreg_gearboxes ;
995
+ goto err_thermal_zone_device_enable ;
995
996
996
997
* p_thermal = thermal ;
997
998
return 0 ;
998
999
999
- err_unreg_gearboxes :
1000
+ err_thermal_zone_device_enable :
1000
1001
mlxsw_thermal_gearboxes_fini (thermal );
1001
- err_unreg_modules_tzdev :
1002
+ err_thermal_gearboxes_init :
1002
1003
mlxsw_thermal_modules_fini (thermal );
1003
- err_unreg_tzdev :
1004
+ err_thermal_modules_init :
1004
1005
if (thermal -> tzdev ) {
1005
1006
thermal_zone_device_unregister (thermal -> tzdev );
1006
1007
thermal -> tzdev = NULL ;
1007
1008
}
1008
- err_unreg_cdevs :
1009
+ err_thermal_zone_device_register :
1010
+ err_thermal_cooling_device_register :
1009
1011
for (i = 0 ; i < MLXSW_MFCR_PWMS_MAX ; i ++ )
1010
1012
if (thermal -> cdevs [i ])
1011
1013
thermal_cooling_device_unregister (thermal -> cdevs [i ]);
1012
- err_free_thermal :
1014
+ err_reg_write :
1015
+ err_reg_query :
1013
1016
devm_kfree (dev , thermal );
1014
1017
return err ;
1015
1018
}
0 commit comments