Commit 1a365616 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Len Brown

ACPI: simplify scan.c coding

No functional changes; just remove leftover, unused "buffer" and simplify
control flow (no need to remember error values and goto the end, when we can
simply return the value directly).
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 683aa401
...@@ -234,12 +234,9 @@ static int acpi_bus_get_power_flags(struct acpi_device *device) ...@@ -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 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 (device->flags.hardware_id)
if (strstr(ids, device->pnp.hardware_id)) if (strstr(ids, device->pnp.hardware_id))
goto Done; return 0;
if (device->flags.compatible_ids) { if (device->flags.compatible_ids) {
struct acpi_compatible_id_list *cid_list = device->pnp.cid_list; 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) ...@@ -248,15 +245,10 @@ int acpi_match_ids(struct acpi_device *device, char *ids)
/* compare multiple _CID entries against driver ids */ /* compare multiple _CID entries against driver ids */
for (i = 0; i < cid_list->count; i++) { for (i = 0; i < cid_list->count; i++) {
if (strstr(ids, cid_list->id[i].value)) if (strstr(ids, cid_list->id[i].value))
goto Done; return 0;
} }
} }
error = -ENOENT; return -ENOENT;
Done:
if (buffer.pointer)
acpi_os_free(buffer.pointer);
return error;
} }
static acpi_status static acpi_status
...@@ -645,21 +637,19 @@ EXPORT_SYMBOL(acpi_bus_register_driver); ...@@ -645,21 +637,19 @@ EXPORT_SYMBOL(acpi_bus_register_driver);
*/ */
int acpi_bus_unregister_driver(struct acpi_driver *driver) int acpi_bus_unregister_driver(struct acpi_driver *driver)
{ {
int error = 0;
ACPI_FUNCTION_TRACE("acpi_bus_unregister_driver"); ACPI_FUNCTION_TRACE("acpi_bus_unregister_driver");
if (driver) { if (!driver)
acpi_driver_detach(driver); return_VALUE(-EINVAL);
if (!atomic_read(&driver->references)) { acpi_driver_detach(driver);
spin_lock(&acpi_device_lock);
list_del_init(&driver->node); if (!atomic_read(&driver->references)) {
spin_unlock(&acpi_device_lock); spin_lock(&acpi_device_lock);
} list_del_init(&driver->node);
} else spin_unlock(&acpi_device_lock);
error = -EINVAL; }
return_VALUE(error); return_VALUE(0);
} }
EXPORT_SYMBOL(acpi_bus_unregister_driver); EXPORT_SYMBOL(acpi_bus_unregister_driver);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment