diff options
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 59639c9c6666..a54ff6bce8fa 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -1262,8 +1262,37 @@ acpi_video_bus_write_DOS(struct file *file, | |||
1262 | 1262 | ||
1263 | static int acpi_video_bus_add_fs(struct acpi_device *device) | 1263 | static int acpi_video_bus_add_fs(struct acpi_device *device) |
1264 | { | 1264 | { |
1265 | long device_id; | ||
1266 | int status; | ||
1265 | struct proc_dir_entry *entry = NULL; | 1267 | struct proc_dir_entry *entry = NULL; |
1266 | struct acpi_video_bus *video; | 1268 | struct acpi_video_bus *video; |
1269 | struct device *dev; | ||
1270 | |||
1271 | status = | ||
1272 | acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id); | ||
1273 | |||
1274 | if (!ACPI_SUCCESS(status)) | ||
1275 | return -ENODEV; | ||
1276 | |||
1277 | /* We need to attempt to determine whether the _ADR refers to a | ||
1278 | PCI device or not. There's no terribly good way to do this, | ||
1279 | so the best we can hope for is to assume that there'll never | ||
1280 | be a video device in the host bridge */ | ||
1281 | if (device_id >= 0x10000) { | ||
1282 | /* It looks like a PCI device. Does it exist? */ | ||
1283 | dev = acpi_get_physical_device(device->handle); | ||
1284 | } else { | ||
1285 | /* It doesn't look like a PCI device. Does its parent | ||
1286 | exist? */ | ||
1287 | acpi_handle phandle; | ||
1288 | if (acpi_get_parent(device->handle, &phandle)) | ||
1289 | return -ENODEV; | ||
1290 | dev = acpi_get_physical_device(phandle); | ||
1291 | } | ||
1292 | if (!dev) | ||
1293 | return -ENODEV; | ||
1294 | put_device(dev); | ||
1295 | |||
1267 | 1296 | ||
1268 | 1297 | ||
1269 | video = acpi_driver_data(device); | 1298 | video = acpi_driver_data(device); |