Skip to content

Commit e7e3a45

Browse files
idoschkuba-moo
authored andcommitted
mlxsw: core_thermal: Remove unnecessary checks
mlxsw_thermal_module_fini() cannot be invoked with a thermal module which is NULL or which is not associated with a thermal zone, so remove these checks. Signed-off-by: Ido Schimmel <[email protected]> Reviewed-by: Vadim Pasternak <[email protected]> Signed-off-by: Petr Machata <[email protected]> Reviewed-by: Wojciech Drewek <[email protected]> Link: https://patch.msgid.link/8db5fe0a3a28ba09a15d4102cc03f7e8ca7675be.1722345311.git.petrm@nvidia.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e25f304 commit e7e3a45

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -467,11 +467,9 @@ mlxsw_thermal_module_init(struct mlxsw_thermal *thermal,
467467

468468
static void mlxsw_thermal_module_fini(struct mlxsw_thermal_module *module_tz)
469469
{
470-
if (module_tz && module_tz->tzdev) {
471-
mlxsw_thermal_module_tz_fini(module_tz->tzdev);
472-
module_tz->tzdev = NULL;
473-
module_tz->parent = NULL;
474-
}
470+
mlxsw_thermal_module_tz_fini(module_tz->tzdev);
471+
module_tz->tzdev = NULL;
472+
module_tz->parent = NULL;
475473
}
476474

477475
static int

0 commit comments

Comments
 (0)