diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-11 12:47:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-01-11 12:47:52 -0500 |
commit | 00fdb75b1959c2f8de8b70bfb63aca422feff2fa (patch) | |
tree | fd0422f86149d6cc739be7af324bcbc7a0968f11 | |
parent | c07d7237a639d57dc91ea7efdbc1b3f85c7a095d (diff) | |
parent | 3d4a7882b11299104a0e74425dece2e26ac98024 (diff) |
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
-rw-r--r-- | drivers/char/agp/backend.c | 13 | ||||
-rw-r--r-- | drivers/char/agp/hp-agp.c | 6 |
2 files changed, 13 insertions, 6 deletions
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index a56ca080e108..c3ab46da51a3 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c | |||
@@ -285,18 +285,22 @@ int agp_add_bridge(struct agp_bridge_data *bridge) | |||
285 | { | 285 | { |
286 | int error; | 286 | int error; |
287 | 287 | ||
288 | if (agp_off) | 288 | if (agp_off) { |
289 | return -ENODEV; | 289 | error = -ENODEV; |
290 | goto err_put_bridge; | ||
291 | } | ||
290 | 292 | ||
291 | if (!bridge->dev) { | 293 | if (!bridge->dev) { |
292 | printk (KERN_DEBUG PFX "Erk, registering with no pci_dev!\n"); | 294 | printk (KERN_DEBUG PFX "Erk, registering with no pci_dev!\n"); |
293 | return -EINVAL; | 295 | error = -EINVAL; |
296 | goto err_put_bridge; | ||
294 | } | 297 | } |
295 | 298 | ||
296 | /* Grab reference on the chipset driver. */ | 299 | /* Grab reference on the chipset driver. */ |
297 | if (!try_module_get(bridge->driver->owner)) { | 300 | if (!try_module_get(bridge->driver->owner)) { |
298 | dev_info(&bridge->dev->dev, "can't lock chipset driver\n"); | 301 | dev_info(&bridge->dev->dev, "can't lock chipset driver\n"); |
299 | return -EINVAL; | 302 | error = -EINVAL; |
303 | goto err_put_bridge; | ||
300 | } | 304 | } |
301 | 305 | ||
302 | error = agp_backend_initialize(bridge); | 306 | error = agp_backend_initialize(bridge); |
@@ -326,6 +330,7 @@ frontend_err: | |||
326 | agp_backend_cleanup(bridge); | 330 | agp_backend_cleanup(bridge); |
327 | err_out: | 331 | err_out: |
328 | module_put(bridge->driver->owner); | 332 | module_put(bridge->driver->owner); |
333 | err_put_bridge: | ||
329 | agp_put_bridge(bridge); | 334 | agp_put_bridge(bridge); |
330 | return error; | 335 | return error; |
331 | } | 336 | } |
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c index 9047b2714653..58752b70efea 100644 --- a/drivers/char/agp/hp-agp.c +++ b/drivers/char/agp/hp-agp.c | |||
@@ -488,9 +488,8 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret) | |||
488 | handle = obj; | 488 | handle = obj; |
489 | do { | 489 | do { |
490 | status = acpi_get_object_info(handle, &info); | 490 | status = acpi_get_object_info(handle, &info); |
491 | if (ACPI_SUCCESS(status)) { | 491 | if (ACPI_SUCCESS(status) && (info->valid & ACPI_VALID_HID)) { |
492 | /* TBD check _CID also */ | 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); | 493 | match = (strcmp(info->hardware_id.string, "HWP0001") == 0); |
495 | kfree(info); | 494 | kfree(info); |
496 | if (match) { | 495 | if (match) { |
@@ -509,6 +508,9 @@ zx1_gart_probe (acpi_handle obj, u32 depth, void *context, void **ret) | |||
509 | handle = parent; | 508 | handle = parent; |
510 | } while (ACPI_SUCCESS(status)); | 509 | } while (ACPI_SUCCESS(status)); |
511 | 510 | ||
511 | if (ACPI_FAILURE(status)) | ||
512 | return AE_OK; /* found no enclosing IOC */ | ||
513 | |||
512 | if (hp_zx1_setup(sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa)) | 514 | if (hp_zx1_setup(sba_hpa + HP_ZX1_IOC_OFFSET, lba_hpa)) |
513 | return AE_OK; | 515 | return AE_OK; |
514 | 516 | ||