Skip to content

Commit 739d56b

Browse files
vadimp-nvidiadavem330
authored andcommitted
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 <vadimp@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6d94449 commit 739d56b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ static int mlxsw_get_cooling_device_idx(struct mlxsw_thermal *thermal,
129129

130130
/* Allow mlxsw thermal zone binding to an external cooling device */
131131
for (i = 0; i < ARRAY_SIZE(mlxsw_thermal_external_allowed_cdev); i++) {
132-
if (strnstr(cdev->type, mlxsw_thermal_external_allowed_cdev[i],
133-
strlen(cdev->type)))
132+
if (!strcmp(cdev->type, mlxsw_thermal_external_allowed_cdev[i]))
134133
return 0;
135134
}
136135

0 commit comments

Comments
 (0)