Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux

Pull thermal management fixes from Zhang Rui:
"Specifics:

- Fix a problem that Intel SoC DTS thermal driver does not work when
CONFIG_THERMAL_INT340X is not set.

- Fix a NULL pointer dereference when processor_thermal_device driver
is loaded on a platform without ACPI support"

* 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
int340x_thermal/processor_thermal_device: return failure when
ACPI/int340x_thermal: enumerate INT3401 for Intel SoC DTS thermal driver
ACPI/int340x_thermal: enumerate INT340X devices even if they're not in _ART/_TRT

+13 -16
+7 -4
drivers/acpi/int340x_thermal.c
··· 14 14 15 15 #include "internal.h" 16 16 17 - #define DO_ENUMERATION 0x01 17 + #define INT3401_DEVICE 0X01 18 18 static const struct acpi_device_id int340x_thermal_device_ids[] = { 19 - {"INT3400", DO_ENUMERATION }, 20 - {"INT3401"}, 19 + {"INT3400"}, 20 + {"INT3401", INT3401_DEVICE}, 21 21 {"INT3402"}, 22 22 {"INT3403"}, 23 23 {"INT3404"}, ··· 34 34 const struct acpi_device_id *id) 35 35 { 36 36 #if defined(CONFIG_INT340X_THERMAL) || defined(CONFIG_INT340X_THERMAL_MODULE) 37 - if (id->driver_data == DO_ENUMERATION) 37 + acpi_create_platform_device(adev); 38 + #elif defined(INTEL_SOC_DTS_THERMAL) || defined(INTEL_SOC_DTS_THERMAL_MODULE) 39 + /* Intel SoC DTS thermal driver needs INT3401 to set IRQ descriptor */ 40 + if (id->driver_data == INT3401_DEVICE) 38 41 acpi_create_platform_device(adev); 39 42 #endif 40 43 return 1;
+4 -12
drivers/thermal/int340x_thermal/acpi_thermal_rel.c
··· 119 119 continue; 120 120 121 121 result = acpi_bus_get_device(trt->source, &adev); 122 - if (!result) 123 - acpi_create_platform_device(adev); 124 - else 122 + if (result) 125 123 pr_warn("Failed to get source ACPI device\n"); 126 124 127 125 result = acpi_bus_get_device(trt->target, &adev); 128 - if (!result) 129 - acpi_create_platform_device(adev); 130 - else 126 + if (result) 131 127 pr_warn("Failed to get target ACPI device\n"); 132 128 } 133 129 ··· 202 206 203 207 if (art->source) { 204 208 result = acpi_bus_get_device(art->source, &adev); 205 - if (!result) 206 - acpi_create_platform_device(adev); 207 - else 209 + if (result) 208 210 pr_warn("Failed to get source ACPI device\n"); 209 211 } 210 212 if (art->target) { 211 213 result = acpi_bus_get_device(art->target, &adev); 212 - if (!result) 213 - acpi_create_platform_device(adev); 214 - else 214 + if (result) 215 215 pr_warn("Failed to get source ACPI device\n"); 216 216 } 217 217 }
+2
drivers/thermal/int340x_thermal/processor_thermal_device.c
··· 130 130 int ret; 131 131 132 132 adev = ACPI_COMPANION(dev); 133 + if (!adev) 134 + return -ENODEV; 133 135 134 136 status = acpi_evaluate_object(adev->handle, "PPCC", NULL, &buf); 135 137 if (ACPI_FAILURE(status))