]> Git Repo - linux.git/commitdiff
Merge branch 'pnpacpi-invalid-device-id' into release
authorLen Brown <[email protected]>
Mon, 25 Oct 2010 06:13:44 +0000 (02:13 -0400)
committerLen Brown <[email protected]>
Mon, 25 Oct 2010 06:13:44 +0000 (02:13 -0400)
1  2 
drivers/pnp/pnpacpi/core.c

index 4aafcf89b03b29527f2c7668fd679f4c19a0cd71,0d943eea1c2d4fe913f23b81002c190aab0c6bcd..2d73dfcecdbb4e2098e3d881a6a091a9e8ca5e62
@@@ -28,7 -28,7 +28,7 @@@
  #include "../base.h"
  #include "pnpacpi.h"
  
- static int num = 0;
+ static int num;
  
  /* We need only to blacklist devices that have already an acpi driver that
   * can't use pnp layer. We don't need to blacklist device that are directly
@@@ -59,7 -59,7 +59,7 @@@ static inline int __init is_exclusive_d
  #define TEST_ALPHA(c) \
        if (!('@' <= (c) || (c) <= 'Z')) \
                return 0
 -static int __init ispnpidacpi(char *id)
 +static int __init ispnpidacpi(const char *id)
  {
        TEST_ALPHA(id[0]);
        TEST_ALPHA(id[1]);
@@@ -180,11 -180,24 +180,24 @@@ struct pnp_protocol pnpacpi_protocol = 
  };
  EXPORT_SYMBOL(pnpacpi_protocol);
  
+ static char *pnpacpi_get_id(struct acpi_device *device)
+ {
+       struct acpi_hardware_id *id;
+       list_for_each_entry(id, &device->pnp.ids, list) {
+               if (ispnpidacpi(id->id))
+                       return id->id;
+       }
+       return NULL;
+ }
  static int __init pnpacpi_add_device(struct acpi_device *device)
  {
        acpi_handle temp = NULL;
        acpi_status status;
        struct pnp_dev *dev;
+       char *pnpid;
        struct acpi_hardware_id *id;
  
        /*
         * driver should not be loaded.
         */
        status = acpi_get_handle(device->handle, "_CRS", &temp);
-       if (ACPI_FAILURE(status) || !ispnpidacpi(acpi_device_hid(device)) ||
-           is_exclusive_device(device) || (!device->status.present))
+       if (ACPI_FAILURE(status))
+               return 0;
+       pnpid = pnpacpi_get_id(device);
+       if (!pnpid)
+               return 0;
+       if (is_exclusive_device(device) || !device->status.present)
                return 0;
  
-       dev = pnp_alloc_dev(&pnpacpi_protocol, num, acpi_device_hid(device));
+       dev = pnp_alloc_dev(&pnpacpi_protocol, num, pnpid);
        if (!dev)
                return -ENOMEM;
  
                pnpacpi_parse_resource_option_data(dev);
  
        list_for_each_entry(id, &device->pnp.ids, list) {
-               if (!strcmp(id->id, acpi_device_hid(device)))
+               if (!strcmp(id->id, pnpid))
                        continue;
                if (!ispnpidacpi(id->id))
                        continue;
This page took 0.056193 seconds and 4 git commands to generate.