ideapad: make sure we bind on the correct device
authorIke Panhc <ike.pan@canonical.com>
Fri, 1 Oct 2010 07:39:14 +0000 (15:39 +0800)
committerMatthew Garrett <mjg@redhat.com>
Thu, 21 Oct 2010 13:36:49 +0000 (09:36 -0400)
By reading from method _CFG to make sure we bind on the correct VPC2004 device.

Signed-off-by: Ike Panhc <ike.pan@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
drivers/platform/x86/ideapad_acpi.c

index e07d6072e75c95316b8dc551557c7769d898fa76..bf684f4212909a9d2d2040c432ab6a987730da96 100644 (file)
@@ -326,10 +326,13 @@ MODULE_DEVICE_TABLE(acpi, ideapad_device_ids);
 
 static int ideapad_acpi_add(struct acpi_device *adevice)
 {
-       int i;
+       int i, cfg;
        int devs_present[5];
        struct ideapad_private *priv;
 
+       if (read_method_int(adevice->handle, "_CFG", &cfg))
+               return -ENODEV;
+
        for (i = IDEAPAD_DEV_CAMERA; i < IDEAPAD_DEV_KILLSW; i++) {
                devs_present[i] = ideapad_dev_exists(i);
                if (devs_present[i] < 0)