From: Vadim Pasternak Date: Wed, 13 Apr 2022 15:17:32 +0000 (+0300) Subject: mlxsw: core_thermal: Use exact name of cooling devices for binding X-Git-Tag: v5.19-rc1~159^2~311^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=739d56bc635e9ba642777445d8c9c37e4a35ba3c;p=thirdparty%2Fkernel%2Flinux.git mlxsw: core_thermal: Use exact name of cooling devices for binding Modular system supports additional cooling devices "mlxreg_fan1", "mlxreg_fan2", etcetera. Thermal zones in "mlxsw" driver should be bound to the same device as before called "mlxreg_fan". Used exact match for cooling device name to avoid binding to new additional cooling devices. Signed-off-by: Vadim Pasternak Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c index 23ff214367d3b..49ea324577031 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c +++ b/drivers/net/ethernet/mellanox/mlxsw/core_thermal.c @@ -129,8 +129,7 @@ static int mlxsw_get_cooling_device_idx(struct mlxsw_thermal *thermal, /* Allow mlxsw thermal zone binding to an external cooling device */ for (i = 0; i < ARRAY_SIZE(mlxsw_thermal_external_allowed_cdev); i++) { - if (strnstr(cdev->type, mlxsw_thermal_external_allowed_cdev[i], - strlen(cdev->type))) + if (!strcmp(cdev->type, mlxsw_thermal_external_allowed_cdev[i])) return 0; }