aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/int340x_thermal/acpi_thermal_rel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/int340x_thermal/acpi_thermal_rel.c')
-rw-r--r--drivers/thermal/int340x_thermal/acpi_thermal_rel.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/thermal/int340x_thermal/acpi_thermal_rel.c b/drivers/thermal/int340x_thermal/acpi_thermal_rel.c
index e4e61b3fb11e..2c2ec7666eb1 100644
--- a/drivers/thermal/int340x_thermal/acpi_thermal_rel.c
+++ b/drivers/thermal/int340x_thermal/acpi_thermal_rel.c
@@ -82,7 +82,7 @@ int acpi_parse_trt(acpi_handle handle, int *trt_count, struct trt **trtp,
82 struct acpi_buffer trt_format = { sizeof("RRNNNNNN"), "RRNNNNNN" }; 82 struct acpi_buffer trt_format = { sizeof("RRNNNNNN"), "RRNNNNNN" };
83 83
84 if (!acpi_has_method(handle, "_TRT")) 84 if (!acpi_has_method(handle, "_TRT"))
85 return 0; 85 return -ENODEV;
86 86
87 status = acpi_evaluate_object(handle, "_TRT", NULL, &buffer); 87 status = acpi_evaluate_object(handle, "_TRT", NULL, &buffer);
88 if (ACPI_FAILURE(status)) 88 if (ACPI_FAILURE(status))
@@ -119,15 +119,11 @@ int acpi_parse_trt(acpi_handle handle, int *trt_count, struct trt **trtp,
119 continue; 119 continue;
120 120
121 result = acpi_bus_get_device(trt->source, &adev); 121 result = acpi_bus_get_device(trt->source, &adev);
122 if (!result) 122 if (result)
123 acpi_create_platform_device(adev);
124 else
125 pr_warn("Failed to get source ACPI device\n"); 123 pr_warn("Failed to get source ACPI device\n");
126 124
127 result = acpi_bus_get_device(trt->target, &adev); 125 result = acpi_bus_get_device(trt->target, &adev);
128 if (!result) 126 if (result)
129 acpi_create_platform_device(adev);
130 else
131 pr_warn("Failed to get target ACPI device\n"); 127 pr_warn("Failed to get target ACPI device\n");
132 } 128 }
133 129
@@ -167,7 +163,7 @@ int acpi_parse_art(acpi_handle handle, int *art_count, struct art **artp,
167 sizeof("RRNNNNNNNNNNN"), "RRNNNNNNNNNNN" }; 163 sizeof("RRNNNNNNNNNNN"), "RRNNNNNNNNNNN" };
168 164
169 if (!acpi_has_method(handle, "_ART")) 165 if (!acpi_has_method(handle, "_ART"))
170 return 0; 166 return -ENODEV;
171 167
172 status = acpi_evaluate_object(handle, "_ART", NULL, &buffer); 168 status = acpi_evaluate_object(handle, "_ART", NULL, &buffer);
173 if (ACPI_FAILURE(status)) 169 if (ACPI_FAILURE(status))
@@ -206,16 +202,12 @@ int acpi_parse_art(acpi_handle handle, int *art_count, struct art **artp,
206 202
207 if (art->source) { 203 if (art->source) {
208 result = acpi_bus_get_device(art->source, &adev); 204 result = acpi_bus_get_device(art->source, &adev);
209 if (!result) 205 if (result)
210 acpi_create_platform_device(adev);
211 else
212 pr_warn("Failed to get source ACPI device\n"); 206 pr_warn("Failed to get source ACPI device\n");
213 } 207 }
214 if (art->target) { 208 if (art->target) {
215 result = acpi_bus_get_device(art->target, &adev); 209 result = acpi_bus_get_device(art->target, &adev);
216 if (!result) 210 if (result)
217 acpi_create_platform_device(adev);
218 else
219 pr_warn("Failed to get source ACPI device\n"); 211 pr_warn("Failed to get source ACPI device\n");
220 } 212 }
221 } 213 }
@@ -321,8 +313,8 @@ static long acpi_thermal_rel_ioctl(struct file *f, unsigned int cmd,
321 unsigned long length = 0; 313 unsigned long length = 0;
322 int count = 0; 314 int count = 0;
323 char __user *arg = (void __user *)__arg; 315 char __user *arg = (void __user *)__arg;
324 struct trt *trts; 316 struct trt *trts = NULL;
325 struct art *arts; 317 struct art *arts = NULL;
326 318
327 switch (cmd) { 319 switch (cmd) {
328 case ACPI_THERMAL_GET_TRT_COUNT: 320 case ACPI_THERMAL_GET_TRT_COUNT: