Skip to content

Commit a5639fa

Browse files
committed
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 <spatra@nvidia.com> Cc: Gal Pressman <gal@nvidia.com> Cc: Saeed Mahameed <saeedm@nvidia.com> Cc: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Simon Horman <simon.horman@corigine.com> Link: https://lore.kernel.org/r/20230525140135.3589917-2-daniel.lezcano@linaro.org
1 parent 62a094e commit a5639fa

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

  • drivers/net/ethernet/mellanox/mlx5/core

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)