]> err.no Git - linux-2.6/blobdiff - drivers/acpi/video.c
ACPI: work around duplicate name "VID" problem on T61
[linux-2.6] / drivers / acpi / video.c
index 04ea697f72bff00b94cc2d1151df53d8b5d93e1e..ac63be4e8197e8c7c30e09e415dc1fc37d925573 100644 (file)
@@ -74,10 +74,16 @@ MODULE_LICENSE("GPL");
 static int acpi_video_bus_add(struct acpi_device *device);
 static int acpi_video_bus_remove(struct acpi_device *device, int type);
 
+static const struct acpi_device_id video_device_ids[] = {
+       {ACPI_VIDEO_HID, 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, video_device_ids);
+
 static struct acpi_driver acpi_video_bus = {
        .name = "video",
        .class = ACPI_VIDEO_CLASS,
-       .ids = ACPI_VIDEO_HID,
+       .ids = video_device_ids,
        .ops = {
                .add = acpi_video_bus_add,
                .remove = acpi_video_bus_remove,
@@ -1827,6 +1833,7 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
        return;
 }
 
+static int instance;
 static int acpi_video_bus_add(struct acpi_device *device)
 {
        int result = 0;
@@ -1841,6 +1848,13 @@ static int acpi_video_bus_add(struct acpi_device *device)
        if (!video)
                return -ENOMEM;
 
+       /* a hack to fix the duplicate name "VID" problem on T61 */
+       if (!strcmp(device->pnp.bus_id, "VID")) {
+               if (instance)
+                       device->pnp.bus_id[3] = '0' + instance;
+               instance ++;
+       }
+
        video->device = device;
        strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);
        strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);