Skip to content

Commit 9b19fcf

Browse files
dlezcanoBrian Maly
authored andcommitted
net/mlx5: Update the driver with the recent thermal changes
The thermal framework is migrating to the generic trip points. The set of changes also implies a self-encapsulation of the thermal zone device structure where the internals are no longer directly accessible but with accessors. Use the new API instead, so the next changes can be pushed in the thermal framework without this driver failing to compile. No functional changes intended. Cc: Sandipan Patra <[email protected]> Cc: Gal Pressman <[email protected]> Cc: Saeed Mahameed <[email protected]> Cc: Jakub Kicinski <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Orabug: 35622106 (cherry picked from commit a5639fa) cherry-pick-repo=kernel/git/torvalds/linux.git unmodified-from-upstream: a5639fa Signed-off-by: Mikhael Goikhman <[email protected]> Signed-off-by: Qing Huang <[email protected]> Reviewed-by: Devesh Sharma <[email protected]> Signed-off-by: Brian Maly <[email protected]>
1 parent 9e66104 commit 9b19fcf

File tree

1 file changed

+8
-7
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core

1 file changed

+8
-7
lines changed

drivers/net/ethernet/mellanox/mlx5/core/thermal.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static int mlx5_thermal_get_mtmp_temp(struct mlx5_core_dev *mdev, u32 id, int *p
4545
static int mlx5_thermal_get_temp(struct thermal_zone_device *tzdev,
4646
int *p_temp)
4747
{
48-
struct mlx5_thermal *thermal = tzdev->devdata;
48+
struct mlx5_thermal *thermal = thermal_zone_device_priv(tzdev);
4949
struct mlx5_core_dev *mdev = thermal->mdev;
5050
int err;
5151

@@ -81,12 +81,13 @@ int mlx5_thermal_init(struct mlx5_core_dev *mdev)
8181
return -ENOMEM;
8282

8383
thermal->mdev = mdev;
84-
thermal->tzdev = thermal_zone_device_register(data,
85-
MLX5_THERMAL_NUM_TRIPS,
86-
MLX5_THERMAL_TRIP_MASK,
87-
thermal,
88-
&mlx5_thermal_ops,
89-
NULL, 0, MLX5_THERMAL_POLL_INT_MSEC);
84+
thermal->tzdev = thermal_zone_device_register_with_trips(data,
85+
NULL,
86+
MLX5_THERMAL_NUM_TRIPS,
87+
MLX5_THERMAL_TRIP_MASK,
88+
thermal,
89+
&mlx5_thermal_ops,
90+
NULL, 0, MLX5_THERMAL_POLL_INT_MSEC);
9091
if (IS_ERR(thermal->tzdev)) {
9192
dev_err(mdev->device, "Failed to register thermal zone device (%s) %ld\n",
9293
data, PTR_ERR(thermal->tzdev));

0 commit comments

Comments
 (0)