Skip to content

Commit

Permalink
Merge branches 'acpi-fan', 'acpi-video' and 'acpi-ec'
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Rafael J. Wysocki committed Dec 18, 2014
4 parents be10f60 + bbb16fe + b4df463 + 1741ace commit 0a06664
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -844,6 +844,8 @@ static int ec_install_handlers(struct acpi_ec *ec)

static void ec_remove_handlers(struct acpi_ec *ec)
{
if (!test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags))
return;
acpi_disable_gpe(NULL, ec->gpe);
if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle,
ACPI_ADR_SPACE_EC, &acpi_ec_space_handler)))
Expand Down
8 changes: 7 additions & 1 deletion drivers/acpi/fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ static int acpi_fan_probe(struct platform_device *pdev)
struct thermal_cooling_device *cdev;
struct acpi_fan *fan;
struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
char *name;

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

cdev = thermal_cooling_device_register("Fan", device,
if (!strncmp(pdev->name, "PNP0C0B", strlen("PNP0C0B")))
name = "Fan";
else
name = acpi_device_bid(device);

cdev = thermal_cooling_device_register(name, device,
&fan_cooling_ops);
if (IS_ERR(cdev)) {
result = PTR_ERR(cdev);
Expand Down
10 changes: 8 additions & 2 deletions drivers/acpi/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ struct acpi_video_bus {
u8 dos_setting;
struct acpi_video_enumerated_device *attached_array;
u8 attached_count;
u8 child_count;
struct acpi_video_bus_cap cap;
struct acpi_video_bus_flags flags;
struct list_head video_device_list;
Expand Down Expand Up @@ -1159,8 +1160,12 @@ static bool acpi_video_device_in_dod(struct acpi_video_device *device)
struct acpi_video_bus *video = device->video;
int i;

/* If we have a broken _DOD, no need to test */
if (!video->attached_count)
/*
* If we have a broken _DOD or we have more than 8 output devices
* under the graphics controller node that we can't proper deal with
* in the operation region code currently, no need to test.
*/
if (!video->attached_count || video->child_count > 8)
return true;

for (i = 0; i < video->attached_count; i++) {
Expand Down Expand Up @@ -1413,6 +1418,7 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
dev_err(&dev->dev, "Can't attach device\n");
break;
}
video->child_count++;
}
return status;
}
Expand Down

0 comments on commit 0a06664

Please sign in to comment.