Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84160
b: refs/heads/master
c: 3fa2cdc
h: refs/heads/master
v: v3
  • Loading branch information
Matthew Garrett authored and Len Brown committed Feb 7, 2008
1 parent 7870bff commit 73b0851
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 863c1490e512db40dab61e44b694a493a9e68b3f
refs/heads/master: 3fa2cdcc45a0176de15cac9dbf4ed2834ebf8932
31 changes: 30 additions & 1 deletion trunk/drivers/acpi/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,11 +730,40 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video)
static int acpi_video_bus_check(struct acpi_video_bus *video)
{
acpi_status status = -ENOENT;

long device_id;
struct device *dev;
struct acpi_device *device;

if (!video)
return -EINVAL;

device = video->device;

status =
acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);

if (!ACPI_SUCCESS(status))
return -ENODEV;

/* We need to attempt to determine whether the _ADR refers to a
PCI device or not. There's no terribly good way to do this,
so the best we can hope for is to assume that there'll never
be a video device in the host bridge */
if (device_id >= 0x10000) {
/* It looks like a PCI device. Does it exist? */
dev = acpi_get_physical_device(device->handle);
} else {
/* It doesn't look like a PCI device. Does its parent
exist? */
acpi_handle phandle;
if (acpi_get_parent(device->handle, &phandle))
return -ENODEV;
dev = acpi_get_physical_device(phandle);
}
if (!dev)
return -ENODEV;
put_device(dev);

/* Since there is no HID, CID and so on for VGA driver, we have
* to check well known required nodes.
*/
Expand Down

0 comments on commit 73b0851

Please sign in to comment.