Skip to content

Commit ce07727

Browse files
committed
Merge back thermal control material for 6.4-rc1.
2 parents 6babf38 + 2b6db9e commit ce07727

67 files changed

Lines changed: 218 additions & 246 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

drivers/acpi/thermal.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
498498

499499
static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
500500
{
501-
struct acpi_thermal *tz = thermal->devdata;
501+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
502502
int result;
503503

504504
if (!tz)
@@ -516,7 +516,7 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
516516
static int thermal_get_trip_type(struct thermal_zone_device *thermal,
517517
int trip, enum thermal_trip_type *type)
518518
{
519-
struct acpi_thermal *tz = thermal->devdata;
519+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
520520
int i;
521521

522522
if (!tz || trip < 0)
@@ -560,7 +560,7 @@ static int thermal_get_trip_type(struct thermal_zone_device *thermal,
560560
static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
561561
int trip, int *temp)
562562
{
563-
struct acpi_thermal *tz = thermal->devdata;
563+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
564564
int i;
565565

566566
if (!tz || trip < 0)
@@ -613,7 +613,7 @@ static int thermal_get_trip_temp(struct thermal_zone_device *thermal,
613613
static int thermal_get_crit_temp(struct thermal_zone_device *thermal,
614614
int *temperature)
615615
{
616-
struct acpi_thermal *tz = thermal->devdata;
616+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
617617

618618
if (tz->trips.critical.flags.valid) {
619619
*temperature = deci_kelvin_to_millicelsius_with_offset(
@@ -628,7 +628,7 @@ static int thermal_get_crit_temp(struct thermal_zone_device *thermal,
628628
static int thermal_get_trend(struct thermal_zone_device *thermal,
629629
int trip, enum thermal_trend *trend)
630630
{
631-
struct acpi_thermal *tz = thermal->devdata;
631+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
632632
enum thermal_trip_type type;
633633
int i;
634634

@@ -670,7 +670,7 @@ static int thermal_get_trend(struct thermal_zone_device *thermal,
670670

671671
static void acpi_thermal_zone_device_hot(struct thermal_zone_device *thermal)
672672
{
673-
struct acpi_thermal *tz = thermal->devdata;
673+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
674674

675675
acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
676676
dev_name(&tz->device->dev),
@@ -679,7 +679,7 @@ static void acpi_thermal_zone_device_hot(struct thermal_zone_device *thermal)
679679

680680
static void acpi_thermal_zone_device_critical(struct thermal_zone_device *thermal)
681681
{
682-
struct acpi_thermal *tz = thermal->devdata;
682+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
683683

684684
acpi_bus_generate_netlink_event(tz->device->pnp.device_class,
685685
dev_name(&tz->device->dev),
@@ -693,7 +693,7 @@ static int acpi_thermal_cooling_device_cb(struct thermal_zone_device *thermal,
693693
bool bind)
694694
{
695695
struct acpi_device *device = cdev->devdata;
696-
struct acpi_thermal *tz = thermal->devdata;
696+
struct acpi_thermal *tz = thermal_zone_device_priv(thermal);
697697
struct acpi_device *dev;
698698
acpi_handle handle;
699699
int i;
@@ -842,7 +842,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
842842
goto acpi_bus_detach;
843843

844844
dev_info(&tz->device->dev, "registered as thermal_zone%d\n",
845-
tz->thermal_zone->id);
845+
thermal_zone_device_id(tz->thermal_zone));
846846

847847
return 0;
848848

drivers/ata/ahci_imx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ static int __sata_ahci_read_temperature(void *dev, int *temp)
418418

419419
static int sata_ahci_read_temperature(struct thermal_zone_device *tz, int *temp)
420420
{
421-
return __sata_ahci_read_temperature(tz->devdata, temp);
421+
return __sata_ahci_read_temperature(thermal_zone_device_priv(tz), temp);
422422
}
423423

424424
static ssize_t sata_ahci_show_temp(struct device *dev,

drivers/hwmon/hwmon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static DEFINE_IDA(hwmon_ida);
154154
#ifdef CONFIG_THERMAL_OF
155155
static int hwmon_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
156156
{
157-
struct hwmon_thermal_data *tdata = tz->devdata;
157+
struct hwmon_thermal_data *tdata = thermal_zone_device_priv(tz);
158158
struct hwmon_device *hwdev = to_hwmon_device(tdata->dev);
159159
int ret;
160160
long t;
@@ -171,7 +171,7 @@ static int hwmon_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
171171

172172
static int hwmon_thermal_set_trips(struct thermal_zone_device *tz, int low, int high)
173173
{
174-
struct hwmon_thermal_data *tdata = tz->devdata;
174+
struct hwmon_thermal_data *tdata = thermal_zone_device_priv(tz);
175175
struct hwmon_device *hwdev = to_hwmon_device(tdata->dev);
176176
const struct hwmon_chip_info *chip = hwdev->chip;
177177
const struct hwmon_channel_info **info = chip->info;

drivers/hwmon/pmbus/pmbus_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ struct pmbus_thermal_data {
12721272

12731273
static int pmbus_thermal_get_temp(struct thermal_zone_device *tz, int *temp)
12741274
{
1275-
struct pmbus_thermal_data *tdata = tz->devdata;
1275+
struct pmbus_thermal_data *tdata = thermal_zone_device_priv(tz);
12761276
struct pmbus_sensor *sensor = tdata->sensor;
12771277
struct pmbus_data *pmbus_data = tdata->pmbus_data;
12781278
struct i2c_client *client = to_i2c_client(pmbus_data->dev);

drivers/hwmon/scmi-hwmon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static int scmi_hwmon_thermal_get_temp(struct thermal_zone_device *tz,
141141
{
142142
int ret;
143143
long value;
144-
struct scmi_thermal_sensor *th_sensor = tz->devdata;
144+
struct scmi_thermal_sensor *th_sensor = thermal_zone_device_priv(tz);
145145

146146
ret = scmi_hwmon_read_scaled_value(th_sensor->ph, th_sensor->info,
147147
&value);
@@ -220,7 +220,7 @@ static int scmi_thermal_sensor_register(struct device *dev,
220220
sensor->name);
221221
} else {
222222
dev_dbg(dev, "Sensor '%s' attached to thermal zone ID:%d\n",
223-
sensor->name, tzd->id);
223+
sensor->name, thermal_zone_device_id(tzd));
224224
}
225225

226226
return 0;

drivers/hwmon/scpi-hwmon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static void scpi_scale_reading(u64 *value, struct sensor_data *sensor)
6464

6565
static int scpi_read_temp(struct thermal_zone_device *tz, int *temp)
6666
{
67-
struct scpi_thermal_zone *zone = tz->devdata;
67+
struct scpi_thermal_zone *zone = thermal_zone_device_priv(tz);
6868
struct scpi_sensors *scpi_sensors = zone->scpi_sensors;
6969
struct scpi_ops *scpi_ops = scpi_sensors->scpi_ops;
7070
struct sensor_data *sensor = &scpi_sensors->data[zone->sensor_id];

drivers/iio/adc/sun4i-gpadc-iio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ static int sun4i_gpadc_runtime_resume(struct device *dev)
414414

415415
static int sun4i_gpadc_get_temp(struct thermal_zone_device *tz, int *temp)
416416
{
417-
struct sun4i_gpadc_iio *info = tz->devdata;
417+
struct sun4i_gpadc_iio *info = thermal_zone_device_priv(tz);
418418
int val, scale, offset;
419419

420420
if (sun4i_gpadc_temp_read(info->indio_dev, &val))

drivers/input/touchscreen/sun4i-ts.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static int sun4i_get_temp(const struct sun4i_ts_data *ts, int *temp)
194194

195195
static int sun4i_get_tz_temp(struct thermal_zone_device *tz, int *temp)
196196
{
197-
return sun4i_get_temp(tz->devdata, temp);
197+
return sun4i_get_temp(thermal_zone_device_priv(tz), temp);
198198
}
199199

200200
static const struct thermal_zone_device_ops sun4i_ts_tz_ops = {

drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
static int cxgb4_thermal_get_temp(struct thermal_zone_device *tzdev,
1313
int *temp)
1414
{
15-
struct adapter *adap = tzdev->devdata;
15+
struct adapter *adap = thermal_zone_device_priv(tzdev);
1616
u32 param, val;
1717
int ret;
1818

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core,
177177

178178
if (crit_temp > emerg_temp) {
179179
dev_warn(dev, "%s : Critical threshold %d is above emergency threshold %d\n",
180-
tz->tzdev->type, crit_temp, emerg_temp);
180+
thermal_zone_device_type(tz->tzdev), crit_temp, emerg_temp);
181181
return 0;
182182
}
183183

@@ -201,7 +201,7 @@ mlxsw_thermal_module_trips_update(struct device *dev, struct mlxsw_core *core,
201201
static int mlxsw_thermal_bind(struct thermal_zone_device *tzdev,
202202
struct thermal_cooling_device *cdev)
203203
{
204-
struct mlxsw_thermal *thermal = tzdev->devdata;
204+
struct mlxsw_thermal *thermal = thermal_zone_device_priv(tzdev);
205205
struct device *dev = thermal->bus_info->dev;
206206
int i, err;
207207

@@ -227,7 +227,7 @@ static int mlxsw_thermal_bind(struct thermal_zone_device *tzdev,
227227
static int mlxsw_thermal_unbind(struct thermal_zone_device *tzdev,
228228
struct thermal_cooling_device *cdev)
229229
{
230-
struct mlxsw_thermal *thermal = tzdev->devdata;
230+
struct mlxsw_thermal *thermal = thermal_zone_device_priv(tzdev);
231231
struct device *dev = thermal->bus_info->dev;
232232
int i;
233233
int err;
@@ -249,7 +249,7 @@ static int mlxsw_thermal_unbind(struct thermal_zone_device *tzdev,
249249
static int mlxsw_thermal_get_temp(struct thermal_zone_device *tzdev,
250250
int *p_temp)
251251
{
252-
struct mlxsw_thermal *thermal = tzdev->devdata;
252+
struct mlxsw_thermal *thermal = thermal_zone_device_priv(tzdev);
253253
struct device *dev = thermal->bus_info->dev;
254254
char mtmp_pl[MLXSW_REG_MTMP_LEN];
255255
int temp;
@@ -281,7 +281,7 @@ static struct thermal_zone_device_ops mlxsw_thermal_ops = {
281281
static int mlxsw_thermal_module_bind(struct thermal_zone_device *tzdev,
282282
struct thermal_cooling_device *cdev)
283283
{
284-
struct mlxsw_thermal_module *tz = tzdev->devdata;
284+
struct mlxsw_thermal_module *tz = thermal_zone_device_priv(tzdev);
285285
struct mlxsw_thermal *thermal = tz->parent;
286286
int i, j, err;
287287

@@ -310,7 +310,7 @@ static int mlxsw_thermal_module_bind(struct thermal_zone_device *tzdev,
310310
static int mlxsw_thermal_module_unbind(struct thermal_zone_device *tzdev,
311311
struct thermal_cooling_device *cdev)
312312
{
313-
struct mlxsw_thermal_module *tz = tzdev->devdata;
313+
struct mlxsw_thermal_module *tz = thermal_zone_device_priv(tzdev);
314314
struct mlxsw_thermal *thermal = tz->parent;
315315
int i;
316316
int err;
@@ -356,7 +356,7 @@ mlxsw_thermal_module_temp_and_thresholds_get(struct mlxsw_core *core,
356356
static int mlxsw_thermal_module_temp_get(struct thermal_zone_device *tzdev,
357357
int *p_temp)
358358
{
359-
struct mlxsw_thermal_module *tz = tzdev->devdata;
359+
struct mlxsw_thermal_module *tz = thermal_zone_device_priv(tzdev);
360360
struct mlxsw_thermal *thermal = tz->parent;
361361
int temp, crit_temp, emerg_temp;
362362
struct device *dev;
@@ -391,7 +391,7 @@ static struct thermal_zone_device_ops mlxsw_thermal_module_ops = {
391391
static int mlxsw_thermal_gearbox_temp_get(struct thermal_zone_device *tzdev,
392392
int *p_temp)
393393
{
394-
struct mlxsw_thermal_module *tz = tzdev->devdata;
394+
struct mlxsw_thermal_module *tz = thermal_zone_device_priv(tzdev);
395395
struct mlxsw_thermal *thermal = tz->parent;
396396
char mtmp_pl[MLXSW_REG_MTMP_LEN];
397397
u16 index;

0 commit comments

Comments
 (0)