Commit c3b659b7 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branches 'thermal-core' and 'thermal-misc'

Merge thermal core updates and miscellaneous updates of the thermal
control subsystem for 6.15-rc1:

 - Delay exposing thermal zone sysfs interface to prevent user space
   from accessing thermal zones that have not been completely
   initialized yet (Lucas De Marchi).

 - Fix a spelling mistake in a comment in the thermal core (Colin Ian
   King).

 - Use kcalloc() instead of kzalloc() in some places in the thermal
   control subsystem (Lukasz Luba, Ethan Carter Edwards).

 - Clean up variable initialization in int340x_thermal_zone_add()
   (Christophe JAILLET).

* thermal-core:
  thermal: core: Delay exposing sysfs interface
  thermal: core: Fix spelling mistake "Occurences" -> "Occurrences"

* thermal-misc:
  thermal: intel: Clean up zone_trips[] initialization in int340x_thermal_zone_add()
  thermal: hisi: Use kcalloc() instead of kzalloc() with multiplication
  thermal: int340x: Use kcalloc() instead of kzalloc() with multiplication
  thermal: k3_j72xx_bandgap: Use kcalloc() instead of kzalloc()
  thermal/of: Use kcalloc() instead of kzalloc() with multiplication
  thermal/debugfs: replace kzalloc() with kcalloc() in thermal_debug_tz_add()
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -412,8 +412,8 @@ static int hi3660_thermal_probe(struct hisi_thermal_data *data)

	data->nr_sensors = 1;

	data->sensor = devm_kzalloc(dev, sizeof(*data->sensor) *
				    data->nr_sensors, GFP_KERNEL);
	data->sensor = devm_kcalloc(dev, data->nr_sensors,
				    sizeof(*data->sensor), GFP_KERNEL);
	if (!data->sensor)
		return -ENOMEM;

+3 −3
Original line number Diff line number Diff line
@@ -133,8 +133,8 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
	if (ACPI_SUCCESS(status))
		int34x_zone->aux_trip_nr = trip_cnt;

	zone_trips = kzalloc(sizeof(*zone_trips) * (trip_cnt + INT340X_THERMAL_MAX_TRIP_COUNT),
			     GFP_KERNEL);
	zone_trips = kcalloc(trip_cnt + INT340X_THERMAL_MAX_TRIP_COUNT,
			     sizeof(*zone_trips), GFP_KERNEL);
	if (!zone_trips) {
		ret = -ENOMEM;
		goto err_trips_alloc;
@@ -143,7 +143,7 @@ struct int34x_thermal_zone *int340x_thermal_zone_add(struct acpi_device *adev,
	for (i = 0; i < trip_cnt; i++) {
		zone_trips[i].type = THERMAL_TRIP_PASSIVE;
		zone_trips[i].temperature = THERMAL_TEMP_INVALID;
		zone_trips[i].flags |= THERMAL_TRIP_FLAG_RW_TEMP;
		zone_trips[i].flags = THERMAL_TRIP_FLAG_RW_TEMP;
		zone_trips[i].priv = THERMAL_INT_TO_TRIP_PRIV(i);
	}

+2 −2
Original line number Diff line number Diff line
@@ -460,13 +460,13 @@ static int k3_j72xx_bandgap_probe(struct platform_device *pdev)
		goto err_alloc;
	}

	ref_table = kzalloc(sizeof(*ref_table) * TABLE_SIZE, GFP_KERNEL);
	ref_table = kcalloc(TABLE_SIZE, sizeof(*ref_table), GFP_KERNEL);
	if (!ref_table) {
		ret = -ENOMEM;
		goto err_alloc;
	}

	derived_table = devm_kzalloc(bgp->dev, sizeof(*derived_table) * TABLE_SIZE,
	derived_table = devm_kcalloc(bgp->dev, TABLE_SIZE, sizeof(*derived_table),
				     GFP_KERNEL);
	if (!derived_table) {
		ret = -ENOMEM;
+10 −10
Original line number Diff line number Diff line
@@ -1589,26 +1589,26 @@ thermal_zone_device_register_with_trips(const char *type,

	tz->state = TZ_STATE_FLAG_INIT;

	result = dev_set_name(&tz->device, "thermal_zone%d", tz->id);
	if (result)
		goto remove_id;

	thermal_zone_device_init(tz);

	result = thermal_zone_init_governor(tz);
	if (result)
		goto remove_id;

	/* sys I/F */
	/* Add nodes that are always present via .groups */
	result = thermal_zone_create_device_groups(tz);
	if (result)
		goto remove_id;

	result = dev_set_name(&tz->device, "thermal_zone%d", tz->id);
	if (result) {
		thermal_zone_destroy_device_groups(tz);
		goto remove_id;
	}
	thermal_zone_device_init(tz);
	result = device_register(&tz->device);
	if (result)
		goto release_device;

	result = thermal_zone_init_governor(tz);
	if (result)
		goto unregister;

	if (!tz->tzp || !tz->tzp->no_hwmon) {
		result = thermal_add_hwmon_sysfs(tz);
		if (result)
+2 −2
Original line number Diff line number Diff line
@@ -319,7 +319,7 @@ static int cdev_tt_seq_show(struct seq_file *s, void *v)
	int i = *(loff_t *)v;

	if (!i)
		seq_puts(s, "Transition\tOccurences\n");
		seq_puts(s, "Transition\tOccurrences\n");

	list_for_each_entry(entry, &transitions[i], node) {
		/*
@@ -876,7 +876,7 @@ void thermal_debug_tz_add(struct thermal_zone_device *tz)

	tz_dbg->tz = tz;

	tz_dbg->trips_crossed = kzalloc(sizeof(int) * tz->num_trips, GFP_KERNEL);
	tz_dbg->trips_crossed = kcalloc(tz->num_trips, sizeof(int), GFP_KERNEL);
	if (!tz_dbg->trips_crossed) {
		thermal_debugfs_remove_id(thermal_dbg);
		return;
Loading