diff options
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r-- | drivers/acpi/scan.c | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index a5fa85832fa3..fc676ac0e3ed 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -142,7 +142,7 @@ static void acpi_device_register(struct acpi_device *device, | |||
142 | create_sysfs_device_files(device); | 142 | create_sysfs_device_files(device); |
143 | } | 143 | } |
144 | 144 | ||
145 | static int acpi_device_unregister(struct acpi_device *device, int type) | 145 | static void acpi_device_unregister(struct acpi_device *device, int type) |
146 | { | 146 | { |
147 | spin_lock(&acpi_device_lock); | 147 | spin_lock(&acpi_device_lock); |
148 | if (device->parent) { | 148 | if (device->parent) { |
@@ -158,7 +158,6 @@ static int acpi_device_unregister(struct acpi_device *device, int type) | |||
158 | acpi_detach_data(device->handle, acpi_bus_data_handler); | 158 | acpi_detach_data(device->handle, acpi_bus_data_handler); |
159 | remove_sysfs_device_files(device); | 159 | remove_sysfs_device_files(device); |
160 | kobject_unregister(&device->kobj); | 160 | kobject_unregister(&device->kobj); |
161 | return 0; | ||
162 | } | 161 | } |
163 | 162 | ||
164 | void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context) | 163 | void acpi_bus_data_handler(acpi_handle handle, u32 function, void *context) |
@@ -537,10 +536,9 @@ static int acpi_start_single_object(struct acpi_device *device) | |||
537 | return_VALUE(result); | 536 | return_VALUE(result); |
538 | } | 537 | } |
539 | 538 | ||
540 | static int acpi_driver_attach(struct acpi_driver *drv) | 539 | static void acpi_driver_attach(struct acpi_driver *drv) |
541 | { | 540 | { |
542 | struct list_head *node, *next; | 541 | struct list_head *node, *next; |
543 | int count = 0; | ||
544 | 542 | ||
545 | ACPI_FUNCTION_TRACE("acpi_driver_attach"); | 543 | ACPI_FUNCTION_TRACE("acpi_driver_attach"); |
546 | 544 | ||
@@ -557,7 +555,6 @@ static int acpi_driver_attach(struct acpi_driver *drv) | |||
557 | if (!acpi_bus_driver_init(dev, drv)) { | 555 | if (!acpi_bus_driver_init(dev, drv)) { |
558 | acpi_start_single_object(dev); | 556 | acpi_start_single_object(dev); |
559 | atomic_inc(&drv->references); | 557 | atomic_inc(&drv->references); |
560 | count++; | ||
561 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 558 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
562 | "Found driver [%s] for device [%s]\n", | 559 | "Found driver [%s] for device [%s]\n", |
563 | drv->name, dev->pnp.bus_id)); | 560 | drv->name, dev->pnp.bus_id)); |
@@ -566,10 +563,9 @@ static int acpi_driver_attach(struct acpi_driver *drv) | |||
566 | spin_lock(&acpi_device_lock); | 563 | spin_lock(&acpi_device_lock); |
567 | } | 564 | } |
568 | spin_unlock(&acpi_device_lock); | 565 | spin_unlock(&acpi_device_lock); |
569 | return_VALUE(count); | ||
570 | } | 566 | } |
571 | 567 | ||
572 | static int acpi_driver_detach(struct acpi_driver *drv) | 568 | static void acpi_driver_detach(struct acpi_driver *drv) |
573 | { | 569 | { |
574 | struct list_head *node, *next; | 570 | struct list_head *node, *next; |
575 | 571 | ||
@@ -591,7 +587,6 @@ static int acpi_driver_detach(struct acpi_driver *drv) | |||
591 | } | 587 | } |
592 | } | 588 | } |
593 | spin_unlock(&acpi_device_lock); | 589 | spin_unlock(&acpi_device_lock); |
594 | return_VALUE(0); | ||
595 | } | 590 | } |
596 | 591 | ||
597 | /** | 592 | /** |
@@ -599,28 +594,22 @@ static int acpi_driver_detach(struct acpi_driver *drv) | |||
599 | * @driver: driver being registered | 594 | * @driver: driver being registered |
600 | * | 595 | * |
601 | * Registers a driver with the ACPI bus. Searches the namespace for all | 596 | * Registers a driver with the ACPI bus. Searches the namespace for all |
602 | * devices that match the driver's criteria and binds. Returns the | 597 | * devices that match the driver's criteria and binds. Returns zero for |
603 | * number of devices that were claimed by the driver, or a negative | 598 | * success or a negative error status for failure. |
604 | * error status for failure. | ||
605 | */ | 599 | */ |
606 | int acpi_bus_register_driver(struct acpi_driver *driver) | 600 | int acpi_bus_register_driver(struct acpi_driver *driver) |
607 | { | 601 | { |
608 | int count; | ||
609 | |||
610 | ACPI_FUNCTION_TRACE("acpi_bus_register_driver"); | 602 | ACPI_FUNCTION_TRACE("acpi_bus_register_driver"); |
611 | 603 | ||
612 | if (acpi_disabled) | 604 | if (acpi_disabled) |
613 | return_VALUE(-ENODEV); | 605 | return_VALUE(-ENODEV); |
614 | 606 | ||
615 | if (!driver) | ||
616 | return_VALUE(-EINVAL); | ||
617 | |||
618 | spin_lock(&acpi_device_lock); | 607 | spin_lock(&acpi_device_lock); |
619 | list_add_tail(&driver->node, &acpi_bus_drivers); | 608 | list_add_tail(&driver->node, &acpi_bus_drivers); |
620 | spin_unlock(&acpi_device_lock); | 609 | spin_unlock(&acpi_device_lock); |
621 | count = acpi_driver_attach(driver); | 610 | acpi_driver_attach(driver); |
622 | 611 | ||
623 | return_VALUE(count); | 612 | return_VALUE(0); |
624 | } | 613 | } |
625 | 614 | ||
626 | EXPORT_SYMBOL(acpi_bus_register_driver); | 615 | EXPORT_SYMBOL(acpi_bus_register_driver); |
@@ -632,13 +621,8 @@ EXPORT_SYMBOL(acpi_bus_register_driver); | |||
632 | * Unregisters a driver with the ACPI bus. Searches the namespace for all | 621 | * Unregisters a driver with the ACPI bus. Searches the namespace for all |
633 | * devices that match the driver's criteria and unbinds. | 622 | * devices that match the driver's criteria and unbinds. |
634 | */ | 623 | */ |
635 | int acpi_bus_unregister_driver(struct acpi_driver *driver) | 624 | void acpi_bus_unregister_driver(struct acpi_driver *driver) |
636 | { | 625 | { |
637 | ACPI_FUNCTION_TRACE("acpi_bus_unregister_driver"); | ||
638 | |||
639 | if (!driver) | ||
640 | return_VALUE(-EINVAL); | ||
641 | |||
642 | acpi_driver_detach(driver); | 626 | acpi_driver_detach(driver); |
643 | 627 | ||
644 | if (!atomic_read(&driver->references)) { | 628 | if (!atomic_read(&driver->references)) { |
@@ -646,7 +630,7 @@ int acpi_bus_unregister_driver(struct acpi_driver *driver) | |||
646 | list_del_init(&driver->node); | 630 | list_del_init(&driver->node); |
647 | spin_unlock(&acpi_device_lock); | 631 | spin_unlock(&acpi_device_lock); |
648 | } | 632 | } |
649 | return_VALUE(0); | 633 | return; |
650 | } | 634 | } |
651 | 635 | ||
652 | EXPORT_SYMBOL(acpi_bus_unregister_driver); | 636 | EXPORT_SYMBOL(acpi_bus_unregister_driver); |