aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2006-06-15 15:37:09 -0400
committerLen Brown <len.brown@intel.com>2006-06-15 15:37:09 -0400
commit63518472c05a351d779f35803e6ccfb361ae630a (patch)
treed3668e960f945a7a1204cfb839bc8aaabcdf2341 /drivers/acpi/scan.c
parente44e20ff1273cf96c7f195297208f654c49295cf (diff)
parente6f1f3c54974a30c65ea0b699809d12f0aa04272 (diff)
Pull trivial1 into release branch
Diffstat (limited to 'drivers/acpi/scan.c')
-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 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)
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
@@ -642,21 +634,19 @@ EXPORT_SYMBOL(acpi_bus_register_driver);
642 */ 634 */
643int acpi_bus_unregister_driver(struct acpi_driver *driver) 635int acpi_bus_unregister_driver(struct acpi_driver *driver)
644{ 636{
645 int error = 0;
646
647 ACPI_FUNCTION_TRACE("acpi_bus_unregister_driver"); 637 ACPI_FUNCTION_TRACE("acpi_bus_unregister_driver");
648 638
649 if (driver) { 639 if (!driver)
650 acpi_driver_detach(driver); 640 return_VALUE(-EINVAL);
651 641
652 if (!atomic_read(&driver->references)) { 642 acpi_driver_detach(driver);
653 spin_lock(&acpi_device_lock); 643
654 list_del_init(&driver->node); 644 if (!atomic_read(&driver->references)) {
655 spin_unlock(&acpi_device_lock); 645 spin_lock(&acpi_device_lock);
656 } 646 list_del_init(&driver->node);
657 } else 647 spin_unlock(&acpi_device_lock);
658 error = -EINVAL; 648 }
659 return_VALUE(error); 649 return_VALUE(0);
660} 650}
661 651
662EXPORT_SYMBOL(acpi_bus_unregister_driver); 652EXPORT_SYMBOL(acpi_bus_unregister_driver);