include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / char / agp / hp-agp.c
index 9047b27..056b289 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/init.h>
 #include <linux/agp_backend.h>
 #include <linux/log2.h>
+#include <linux/slab.h>
 
 #include <asm/acpi-ext.h>
 
@@ -488,9 +489,8 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret)
        handle = obj;
        do {
                status = acpi_get_object_info(handle, &info);
-               if (ACPI_SUCCESS(status)) {
+               if (ACPI_SUCCESS(status) && (info->valid & ACPI_VALID_HID)) {
                        /* TBD check _CID also */
-                       info->hardware_id.string[sizeof(info->hardware_id.length)-1] = '\0';
                        match = (strcmp(info->hardware_id.string, "HWP0001") == 0);
                        kfree(info);
                        if (match) {
@@ -509,6 +509,9 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret)
                handle = parent;
        } while (ACPI_SUCCESS(status));
 
+       if (ACPI_FAILURE(status))
+               return AE_OK;   /* found no enclosing IOC */
+
        if (hp_zx1_setup(sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa))
                return AE_OK;