Commit 0a0666428680c4a68d050491d5323a2ef05e08a7
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
Merge branches 'acpi-fan', 'acpi-video' and 'acpi-ec'
* acpi-fan: ACPI / Fan: Use bus id as the name for non PNP0C0B (Fan) devices * acpi-video: ACPI / video: update the skip case for acpi_video_device_in_dod() * acpi-ec: ACPI / EC: Fix unexpected ec_remove_handlers() invocations
Showing 3 changed files Side-by-side Diff
drivers/acpi/ec.c
... | ... | @@ -844,6 +844,8 @@ |
844 | 844 | |
845 | 845 | static void ec_remove_handlers(struct acpi_ec *ec) |
846 | 846 | { |
847 | + if (!test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags)) | |
848 | + return; | |
847 | 849 | acpi_disable_gpe(NULL, ec->gpe); |
848 | 850 | if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle, |
849 | 851 | ACPI_ADR_SPACE_EC, &acpi_ec_space_handler))) |
drivers/acpi/fan.c
... | ... | @@ -325,6 +325,7 @@ |
325 | 325 | struct thermal_cooling_device *cdev; |
326 | 326 | struct acpi_fan *fan; |
327 | 327 | struct acpi_device *device = ACPI_COMPANION(&pdev->dev); |
328 | + char *name; | |
328 | 329 | |
329 | 330 | fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL); |
330 | 331 | if (!fan) { |
... | ... | @@ -346,7 +347,12 @@ |
346 | 347 | } |
347 | 348 | } |
348 | 349 | |
349 | - cdev = thermal_cooling_device_register("Fan", device, | |
350 | + if (!strncmp(pdev->name, "PNP0C0B", strlen("PNP0C0B"))) | |
351 | + name = "Fan"; | |
352 | + else | |
353 | + name = acpi_device_bid(device); | |
354 | + | |
355 | + cdev = thermal_cooling_device_register(name, device, | |
350 | 356 | &fan_cooling_ops); |
351 | 357 | if (IS_ERR(cdev)) { |
352 | 358 | result = PTR_ERR(cdev); |
drivers/acpi/video.c
... | ... | @@ -155,6 +155,7 @@ |
155 | 155 | u8 dos_setting; |
156 | 156 | struct acpi_video_enumerated_device *attached_array; |
157 | 157 | u8 attached_count; |
158 | + u8 child_count; | |
158 | 159 | struct acpi_video_bus_cap cap; |
159 | 160 | struct acpi_video_bus_flags flags; |
160 | 161 | struct list_head video_device_list; |
... | ... | @@ -1159,8 +1160,12 @@ |
1159 | 1160 | struct acpi_video_bus *video = device->video; |
1160 | 1161 | int i; |
1161 | 1162 | |
1162 | - /* If we have a broken _DOD, no need to test */ | |
1163 | - if (!video->attached_count) | |
1163 | + /* | |
1164 | + * If we have a broken _DOD or we have more than 8 output devices | |
1165 | + * under the graphics controller node that we can't proper deal with | |
1166 | + * in the operation region code currently, no need to test. | |
1167 | + */ | |
1168 | + if (!video->attached_count || video->child_count > 8) | |
1164 | 1169 | return true; |
1165 | 1170 | |
1166 | 1171 | for (i = 0; i < video->attached_count; i++) { |
... | ... | @@ -1413,6 +1418,7 @@ |
1413 | 1418 | dev_err(&dev->dev, "Can't attach device\n"); |
1414 | 1419 | break; |
1415 | 1420 | } |
1421 | + video->child_count++; | |
1416 | 1422 | } |
1417 | 1423 | return status; |
1418 | 1424 | } |