diff options
author | Len Brown <len.brown@intel.com> | 2006-06-15 15:37:09 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-06-15 15:37:09 -0400 |
commit | 63518472c05a351d779f35803e6ccfb361ae630a (patch) | |
tree | d3668e960f945a7a1204cfb839bc8aaabcdf2341 /drivers/acpi/scan.c | |
parent | e44e20ff1273cf96c7f195297208f654c49295cf (diff) | |
parent | e6f1f3c54974a30c65ea0b699809d12f0aa04272 (diff) |
Pull trivial1 into release branch
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r-- | drivers/acpi/scan.c | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 95d5bc2acadd..a5fa85832fa3 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -234,12 +234,9 @@ static int acpi_bus_get_power_flags(struct acpi_device *device) int acpi_match_ids(struct acpi_device *device, char *ids) { - int error = 0; - struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; - if (device->flags.hardware_id) if (strstr(ids, device->pnp.hardware_id)) - goto Done; + return 0; if (device->flags.compatible_ids) { struct acpi_compatible_id_list *cid_list = device->pnp.cid_list; @@ -248,15 +245,10 @@ int acpi_match_ids(struct acpi_device *device, char *ids) /* compare multiple _CID entries against driver ids */ for (i = 0; i < cid_list->count; i++) { if (strstr(ids, cid_list->id[i].value)) - goto Done; + return 0; } } - error = -ENOENT; - - Done: - if (buffer.pointer) - acpi_os_free(buffer.pointer); - return error; + return -ENOENT; } static acpi_status @@ -642,21 +634,19 @@ EXPORT_SYMBOL(acpi_bus_register_driver); */ int acpi_bus_unregister_driver(struct acpi_driver *driver) { - int error = 0; - ACPI_FUNCTION_TRACE("acpi_bus_unregister_driver"); - if (driver) { - acpi_driver_detach(driver); + if (!driver) + return_VALUE(-EINVAL); - if (!atomic_read(&driver->references)) { - spin_lock(&acpi_device_lock); - list_del_init(&driver->node); - spin_unlock(&acpi_device_lock); - } - } else - error = -EINVAL; - return_VALUE(error); + acpi_driver_detach(driver); + + if (!atomic_read(&driver->references)) { + spin_lock(&acpi_device_lock); + list_del_init(&driver->node); + spin_unlock(&acpi_device_lock); + } + return_VALUE(0); } EXPORT_SYMBOL(acpi_bus_unregister_driver); |