Skip to content

Commit

Permalink
Merge branch 'agp-fixes' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Jan 11, 2010
2 parents c07d723 + 3d4a788 commit 00fdb75
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
13 changes: 9 additions & 4 deletions drivers/char/agp/backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,18 +285,22 @@ int agp_add_bridge(struct agp_bridge_data *bridge)
{
int error;

if (agp_off)
return -ENODEV;
if (agp_off) {
error = -ENODEV;
goto err_put_bridge;
}

if (!bridge->dev) {
printk (KERN_DEBUG PFX "Erk, registering with no pci_dev!\n");
return -EINVAL;
error = -EINVAL;
goto err_put_bridge;
}

/* Grab reference on the chipset driver. */
if (!try_module_get(bridge->driver->owner)) {
dev_info(&bridge->dev->dev, "can't lock chipset driver\n");
return -EINVAL;
error = -EINVAL;
goto err_put_bridge;
}

error = agp_backend_initialize(bridge);
Expand Down Expand Up @@ -326,6 +330,7 @@ int agp_add_bridge(struct agp_bridge_data *bridge)
agp_backend_cleanup(bridge);
err_out:
module_put(bridge->driver->owner);
err_put_bridge:
agp_put_bridge(bridge);
return error;
}
Expand Down
6 changes: 4 additions & 2 deletions drivers/char/agp/hp-agp.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,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) {
Expand All @@ -509,6 +508,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;

Expand Down

0 comments on commit 00fdb75

Please sign in to comment.