diff options
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 60 |
1 files changed, 1 insertions, 59 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 1bc0c74f2755..12fb44f16766 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -807,40 +807,11 @@ static void acpi_video_bus_find_cap(struct acpi_video_bus *video) | |||
807 | static int acpi_video_bus_check(struct acpi_video_bus *video) | 807 | static int acpi_video_bus_check(struct acpi_video_bus *video) |
808 | { | 808 | { |
809 | acpi_status status = -ENOENT; | 809 | acpi_status status = -ENOENT; |
810 | long device_id; | 810 | |
811 | struct device *dev; | ||
812 | struct acpi_device *device; | ||
813 | 811 | ||
814 | if (!video) | 812 | if (!video) |
815 | return -EINVAL; | 813 | return -EINVAL; |
816 | 814 | ||
817 | device = video->device; | ||
818 | |||
819 | status = | ||
820 | acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id); | ||
821 | |||
822 | if (!ACPI_SUCCESS(status)) | ||
823 | return -ENODEV; | ||
824 | |||
825 | /* We need to attempt to determine whether the _ADR refers to a | ||
826 | PCI device or not. There's no terribly good way to do this, | ||
827 | so the best we can hope for is to assume that there'll never | ||
828 | be a video device in the host bridge */ | ||
829 | if (device_id >= 0x10000) { | ||
830 | /* It looks like a PCI device. Does it exist? */ | ||
831 | dev = acpi_get_physical_device(device->handle); | ||
832 | } else { | ||
833 | /* It doesn't look like a PCI device. Does its parent | ||
834 | exist? */ | ||
835 | acpi_handle phandle; | ||
836 | if (acpi_get_parent(device->handle, &phandle)) | ||
837 | return -ENODEV; | ||
838 | dev = acpi_get_physical_device(phandle); | ||
839 | } | ||
840 | if (!dev) | ||
841 | return -ENODEV; | ||
842 | put_device(dev); | ||
843 | |||
844 | /* Since there is no HID, CID and so on for VGA driver, we have | 815 | /* Since there is no HID, CID and so on for VGA driver, we have |
845 | * to check well known required nodes. | 816 | * to check well known required nodes. |
846 | */ | 817 | */ |
@@ -1366,37 +1337,8 @@ acpi_video_bus_write_DOS(struct file *file, | |||
1366 | 1337 | ||
1367 | static int acpi_video_bus_add_fs(struct acpi_device *device) | 1338 | static int acpi_video_bus_add_fs(struct acpi_device *device) |
1368 | { | 1339 | { |
1369 | long device_id; | ||
1370 | int status; | ||
1371 | struct proc_dir_entry *entry = NULL; | 1340 | struct proc_dir_entry *entry = NULL; |
1372 | struct acpi_video_bus *video; | 1341 | struct acpi_video_bus *video; |
1373 | struct device *dev; | ||
1374 | |||
1375 | status = | ||
1376 | acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id); | ||
1377 | |||
1378 | if (!ACPI_SUCCESS(status)) | ||
1379 | return -ENODEV; | ||
1380 | |||
1381 | /* We need to attempt to determine whether the _ADR refers to a | ||
1382 | PCI device or not. There's no terribly good way to do this, | ||
1383 | so the best we can hope for is to assume that there'll never | ||
1384 | be a video device in the host bridge */ | ||
1385 | if (device_id >= 0x10000) { | ||
1386 | /* It looks like a PCI device. Does it exist? */ | ||
1387 | dev = acpi_get_physical_device(device->handle); | ||
1388 | } else { | ||
1389 | /* It doesn't look like a PCI device. Does its parent | ||
1390 | exist? */ | ||
1391 | acpi_handle phandle; | ||
1392 | if (acpi_get_parent(device->handle, &phandle)) | ||
1393 | return -ENODEV; | ||
1394 | dev = acpi_get_physical_device(phandle); | ||
1395 | } | ||
1396 | if (!dev) | ||
1397 | return -ENODEV; | ||
1398 | put_device(dev); | ||
1399 | |||
1400 | 1342 | ||
1401 | 1343 | ||
1402 | video = acpi_driver_data(device); | 1344 | video = acpi_driver_data(device); |