aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/video.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index b5e35cd559ea..970c01a7f8f4 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -730,11 +730,40 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video)
730static int acpi_video_bus_check(struct acpi_video_bus *video) 730static int acpi_video_bus_check(struct acpi_video_bus *video)
731{ 731{
732 acpi_status status = -ENOENT; 732 acpi_status status = -ENOENT;
733 733 long device_id;
734 struct device *dev;
735 struct acpi_device *device;
734 736
735 if (!video) 737 if (!video)
736 return -EINVAL; 738 return -EINVAL;
737 739
740 device = video->device;
741
742 status =
743 acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
744
745 if (!ACPI_SUCCESS(status))
746 return -ENODEV;
747
748 /* We need to attempt to determine whether the _ADR refers to a
749 PCI device or not. There's no terribly good way to do this,
750 so the best we can hope for is to assume that there'll never
751 be a video device in the host bridge */
752 if (device_id >= 0x10000) {
753 /* It looks like a PCI device. Does it exist? */
754 dev = acpi_get_physical_device(device->handle);
755 } else {
756 /* It doesn't look like a PCI device. Does its parent
757 exist? */
758 acpi_handle phandle;
759 if (acpi_get_parent(device->handle, &phandle))
760 return -ENODEV;
761 dev = acpi_get_physical_device(phandle);
762 }
763 if (!dev)
764 return -ENODEV;
765 put_device(dev);
766
738 /* Since there is no HID, CID and so on for VGA driver, we have 767 /* Since there is no HID, CID and so on for VGA driver, we have
739 * to check well known required nodes. 768 * to check well known required nodes.
740 */ 769 */