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