aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2006-03-28 17:04:00 -0500
committerLen Brown <len.brown@intel.com>2006-04-01 21:53:51 -0500
commit1a36561607abf1405b56a41aac2fd163429cd1f8 (patch)
tree096ea8a5212164643e54218a2d4b76ecdec95350 /drivers/acpi
parent683aa4012f53b2ada0f430487e05d37b0d94e90a (diff)
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: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/scan.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index a0ab828b2cc5..08ba85cab2dd 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)
234 234
235int acpi_match_ids(struct acpi_device *device, char *ids) 235int acpi_match_ids(struct acpi_device *device, char *ids)
236{ 236{
237 int error = 0;
238 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
239
240 if (device->flags.hardware_id) 237 if (device->flags.hardware_id)
241 if (strstr(ids, device->pnp.hardware_id)) 238 if (strstr(ids, device->pnp.hardware_id))
242 goto Done; 239 return 0;
243 240
244 if (device->flags.compatible_ids) { 241 if (device->flags.compatible_ids) {
245 struct acpi_compatible_id_list *cid_list = device->pnp.cid_list; 242 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 /* compare multiple _CID entries against driver ids */ 245 /* compare multiple _CID entries against driver ids */
249 for (i = 0; i < cid_list->count; i++) { 246 for (i = 0; i < cid_list->count; i++) {
250 if (strstr(ids, cid_list->id[i].value)) 247 if (strstr(ids, cid_list->id[i].value))
251 goto Done; 248 return 0;
252 } 249 }
253 } 250 }
254 error = -ENOENT; 251 return -ENOENT;
255
256 Done:
257 if (buffer.pointer)
258 acpi_os_free(buffer.pointer);
259 return error;
260} 252}
261 253
262static acpi_status 254static acpi_status
@@ -645,21 +637,19 @@ EXPORT_SYMBOL(acpi_bus_register_driver);
645 */ 637 */
646int acpi_bus_unregister_driver(struct acpi_driver *driver) 638int acpi_bus_unregister_driver(struct acpi_driver *driver)
647{ 639{
648 int error = 0;
649
650 ACPI_FUNCTION_TRACE("acpi_bus_unregister_driver"); 640 ACPI_FUNCTION_TRACE("acpi_bus_unregister_driver");
651 641
652 if (driver) { 642 if (!driver)
653 acpi_driver_detach(driver); 643 return_VALUE(-EINVAL);
654 644
655 if (!atomic_read(&driver->references)) { 645 acpi_driver_detach(driver);
656 spin_lock(&acpi_device_lock); 646
657 list_del_init(&driver->node); 647 if (!atomic_read(&driver->references)) {
658 spin_unlock(&acpi_device_lock); 648 spin_lock(&acpi_device_lock);
659 } 649 list_del_init(&driver->node);
660 } else 650 spin_unlock(&acpi_device_lock);
661 error = -EINVAL; 651 }
662 return_VALUE(error); 652 return_VALUE(0);
663} 653}
664 654
665EXPORT_SYMBOL(acpi_bus_unregister_driver); 655EXPORT_SYMBOL(acpi_bus_unregister_driver);