Skip to content

Commit 0a06664

Browse files
committed
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
4 parents be10f60 + bbb16fe + b4df463 + 1741ace commit 0a06664

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

drivers/acpi/ec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,8 @@ static int ec_install_handlers(struct acpi_ec *ec)
844844

845845
static void ec_remove_handlers(struct acpi_ec *ec)
846846
{
847+
if (!test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags))
848+
return;
847849
acpi_disable_gpe(NULL, ec->gpe);
848850
if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle,
849851
ACPI_ADR_SPACE_EC, &acpi_ec_space_handler)))

drivers/acpi/fan.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ static int acpi_fan_probe(struct platform_device *pdev)
325325
struct thermal_cooling_device *cdev;
326326
struct acpi_fan *fan;
327327
struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
328+
char *name;
328329

329330
fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL);
330331
if (!fan) {
@@ -346,7 +347,12 @@ static int acpi_fan_probe(struct platform_device *pdev)
346347
}
347348
}
348349

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,
350356
&fan_cooling_ops);
351357
if (IS_ERR(cdev)) {
352358
result = PTR_ERR(cdev);

drivers/acpi/video.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ struct acpi_video_bus {
155155
u8 dos_setting;
156156
struct acpi_video_enumerated_device *attached_array;
157157
u8 attached_count;
158+
u8 child_count;
158159
struct acpi_video_bus_cap cap;
159160
struct acpi_video_bus_flags flags;
160161
struct list_head video_device_list;
@@ -1159,8 +1160,12 @@ static bool acpi_video_device_in_dod(struct acpi_video_device *device)
11591160
struct acpi_video_bus *video = device->video;
11601161
int i;
11611162

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)
11641169
return true;
11651170

11661171
for (i = 0; i < video->attached_count; i++) {
@@ -1413,6 +1418,7 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
14131418
dev_err(&dev->dev, "Can't attach device\n");
14141419
break;
14151420
}
1421+
video->child_count++;
14161422
}
14171423
return status;
14181424
}

0 commit comments

Comments
 (0)