Merge branch 'agp-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6

* 'agp-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6:
agp/hp: fail gracefully if we don't find an IOC
agp/hp: fixup hp agp after ACPI changes
agp: correct missing cleanup on error in agp_add_bridge

+13 -6
+9 -4
drivers/char/agp/backend.c
··· 285 { 286 int error; 287 288 - if (agp_off) 289 - return -ENODEV; 290 291 if (!bridge->dev) { 292 printk (KERN_DEBUG PFX "Erk, registering with no pci_dev!\n"); 293 - return -EINVAL; 294 } 295 296 /* Grab reference on the chipset driver. */ 297 if (!try_module_get(bridge->driver->owner)) { 298 dev_info(&bridge->dev->dev, "can't lock chipset driver\n"); 299 - return -EINVAL; 300 } 301 302 error = agp_backend_initialize(bridge); ··· 330 agp_backend_cleanup(bridge); 331 err_out: 332 module_put(bridge->driver->owner); 333 agp_put_bridge(bridge); 334 return error; 335 }
··· 285 { 286 int error; 287 288 + if (agp_off) { 289 + error = -ENODEV; 290 + goto err_put_bridge; 291 + } 292 293 if (!bridge->dev) { 294 printk (KERN_DEBUG PFX "Erk, registering with no pci_dev!\n"); 295 + error = -EINVAL; 296 + goto err_put_bridge; 297 } 298 299 /* Grab reference on the chipset driver. */ 300 if (!try_module_get(bridge->driver->owner)) { 301 dev_info(&bridge->dev->dev, "can't lock chipset driver\n"); 302 + error = -EINVAL; 303 + goto err_put_bridge; 304 } 305 306 error = agp_backend_initialize(bridge); ··· 326 agp_backend_cleanup(bridge); 327 err_out: 328 module_put(bridge->driver->owner); 329 + err_put_bridge: 330 agp_put_bridge(bridge); 331 return error; 332 }
+4 -2
drivers/char/agp/hp-agp.c
··· 488 handle = obj; 489 do { 490 status = acpi_get_object_info(handle, &info); 491 - if (ACPI_SUCCESS(status)) { 492 /* TBD check _CID also */ 493 - info->hardware_id.string[sizeof(info->hardware_id.length)-1] = '\0'; 494 match = (strcmp(info->hardware_id.string, "HWP0001") == 0); 495 kfree(info); 496 if (match) { ··· 507 status = acpi_get_parent(handle, &parent); 508 handle = parent; 509 } while (ACPI_SUCCESS(status)); 510 511 if (hp_zx1_setup(sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa)) 512 return AE_OK;
··· 488 handle = obj; 489 do { 490 status = acpi_get_object_info(handle, &info); 491 + if (ACPI_SUCCESS(status) && (info->valid & ACPI_VALID_HID)) { 492 /* TBD check _CID also */ 493 match = (strcmp(info->hardware_id.string, "HWP0001") == 0); 494 kfree(info); 495 if (match) { ··· 508 status = acpi_get_parent(handle, &parent); 509 handle = parent; 510 } while (ACPI_SUCCESS(status)); 511 + 512 + if (ACPI_FAILURE(status)) 513 + return AE_OK; /* found no enclosing IOC */ 514 515 if (hp_zx1_setup(sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa)) 516 return AE_OK;