Skip to content

Commit 009da9f

Browse files
vadimp-nvidiadavem330
authored andcommitted
mlxsw: core_thermal: Rename labels according to naming convention
Rename labels for error flow handling in order to align with naming convention used in rest of 'mlxsw' code. Signed-off-by: Vadim Pasternak <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bed8f41 commit 009da9f

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

drivers/net/ethernet/mellanox/mlxsw/core_thermal.c

+23-20
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,11 @@ static int mlxsw_thermal_module_bind(struct thermal_zone_device *tzdev,
392392
trip->min_state,
393393
THERMAL_WEIGHT_DEFAULT);
394394
if (err < 0)
395-
goto err_bind_cooling_device;
395+
goto err_thermal_zone_bind_cooling_device;
396396
}
397397
return 0;
398398

399-
err_bind_cooling_device:
399+
err_thermal_zone_bind_cooling_device:
400400
for (j = i - 1; j >= 0; j--)
401401
thermal_zone_unbind_cooling_device(tzdev, j, cdev);
402402
return err;
@@ -766,7 +766,7 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core,
766766
for (i = 0; i < thermal->tz_module_num; i++) {
767767
err = mlxsw_thermal_module_init(dev, core, thermal, i);
768768
if (err)
769-
goto err_unreg_tz_module_arr;
769+
goto err_thermal_module_init;
770770
}
771771

772772
for (i = 0; i < thermal->tz_module_num; i++) {
@@ -775,12 +775,13 @@ mlxsw_thermal_modules_init(struct device *dev, struct mlxsw_core *core,
775775
continue;
776776
err = mlxsw_thermal_module_tz_init(module_tz);
777777
if (err)
778-
goto err_unreg_tz_module_arr;
778+
goto err_thermal_module_tz_init;
779779
}
780780

781781
return 0;
782782

783-
err_unreg_tz_module_arr:
783+
err_thermal_module_tz_init:
784+
err_thermal_module_init:
784785
for (i = thermal->tz_module_num - 1; i >= 0; i--)
785786
mlxsw_thermal_module_fini(&thermal->tz_module_arr[i]);
786787
kfree(thermal->tz_module_arr);
@@ -871,12 +872,12 @@ mlxsw_thermal_gearboxes_init(struct device *dev, struct mlxsw_core *core,
871872
gearbox_tz->parent = thermal;
872873
err = mlxsw_thermal_gearbox_tz_init(gearbox_tz);
873874
if (err)
874-
goto err_unreg_tz_gearbox;
875+
goto err_thermal_gearbox_tz_init;
875876
}
876877

877878
return 0;
878879

879-
err_unreg_tz_gearbox:
880+
err_thermal_gearbox_tz_init:
880881
for (i--; i >= 0; i--)
881882
mlxsw_thermal_gearbox_tz_fini(&thermal->tz_gearbox_arr[i]);
882883
kfree(thermal->tz_gearbox_arr);
@@ -920,7 +921,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core,
920921
err = mlxsw_reg_query(thermal->core, MLXSW_REG(mfcr), mfcr_pl);
921922
if (err) {
922923
dev_err(dev, "Failed to probe PWMs\n");
923-
goto err_free_thermal;
924+
goto err_reg_query;
924925
}
925926
mlxsw_reg_mfcr_unpack(mfcr_pl, &freq, &tacho_active, &pwm_active);
926927

@@ -934,14 +935,14 @@ int mlxsw_thermal_init(struct mlxsw_core *core,
934935
err = mlxsw_reg_query(thermal->core, MLXSW_REG(mfsl),
935936
mfsl_pl);
936937
if (err)
937-
goto err_free_thermal;
938+
goto err_reg_query;
938939

939940
/* set the minimal RPMs to 0 */
940941
mlxsw_reg_mfsl_tach_min_set(mfsl_pl, 0);
941942
err = mlxsw_reg_write(thermal->core, MLXSW_REG(mfsl),
942943
mfsl_pl);
943944
if (err)
944-
goto err_free_thermal;
945+
goto err_reg_write;
945946
}
946947
}
947948
for (i = 0; i < MLXSW_MFCR_PWMS_MAX; i++) {
@@ -954,7 +955,7 @@ int mlxsw_thermal_init(struct mlxsw_core *core,
954955
if (IS_ERR(cdev)) {
955956
err = PTR_ERR(cdev);
956957
dev_err(dev, "Failed to register cooling device\n");
957-
goto err_unreg_cdevs;
958+
goto err_thermal_cooling_device_register;
958959
}
959960
thermal->cdevs[i] = cdev;
960961
}
@@ -978,38 +979,40 @@ int mlxsw_thermal_init(struct mlxsw_core *core,
978979
if (IS_ERR(thermal->tzdev)) {
979980
err = PTR_ERR(thermal->tzdev);
980981
dev_err(dev, "Failed to register thermal zone\n");
981-
goto err_unreg_cdevs;
982+
goto err_thermal_zone_device_register;
982983
}
983984

984985
err = mlxsw_thermal_modules_init(dev, core, thermal);
985986
if (err)
986-
goto err_unreg_tzdev;
987+
goto err_thermal_modules_init;
987988

988989
err = mlxsw_thermal_gearboxes_init(dev, core, thermal);
989990
if (err)
990-
goto err_unreg_modules_tzdev;
991+
goto err_thermal_gearboxes_init;
991992

992993
err = thermal_zone_device_enable(thermal->tzdev);
993994
if (err)
994-
goto err_unreg_gearboxes;
995+
goto err_thermal_zone_device_enable;
995996

996997
*p_thermal = thermal;
997998
return 0;
998999

999-
err_unreg_gearboxes:
1000+
err_thermal_zone_device_enable:
10001001
mlxsw_thermal_gearboxes_fini(thermal);
1001-
err_unreg_modules_tzdev:
1002+
err_thermal_gearboxes_init:
10021003
mlxsw_thermal_modules_fini(thermal);
1003-
err_unreg_tzdev:
1004+
err_thermal_modules_init:
10041005
if (thermal->tzdev) {
10051006
thermal_zone_device_unregister(thermal->tzdev);
10061007
thermal->tzdev = NULL;
10071008
}
1008-
err_unreg_cdevs:
1009+
err_thermal_zone_device_register:
1010+
err_thermal_cooling_device_register:
10091011
for (i = 0; i < MLXSW_MFCR_PWMS_MAX; i++)
10101012
if (thermal->cdevs[i])
10111013
thermal_cooling_device_unregister(thermal->cdevs[i]);
1012-
err_free_thermal:
1014+
err_reg_write:
1015+
err_reg_query:
10131016
devm_kfree(dev, thermal);
10141017
return err;
10151018
}

0 commit comments

Comments
 (0)