aboutsummaryrefslogtreecommitdiffstats
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:42:57 -0500
commit9d9f749b316ac21cb59ad3e595cbce469b409e1a (patch)
treea7075d54e97fc67f72684a5e280adcb24c4666b8
parent683aa4012f53b2ada0f430487e05d37b0d94e90a (diff)
ACPI: make acpi_bus_register_driver() return success/failure, not device count
acpi_bus_register_driver() should not return the number of devices claimed. We're not asking to find devices, we're making a driver available to devices, including hot-pluggable devices that may appear in the future. I audited all callers of acpi_bus_register_driver(), and except asus_acpi.c and sonypi.c (fixed in previous patches), all either ignore the return value or test only for failure (<0). 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>
-rw-r--r--drivers/acpi/scan.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index a0ab828b2cc5..669553553fbb 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -548,10 +548,9 @@ static int acpi_start_single_object(struct acpi_device *device)
548 return_VALUE(result); 548 return_VALUE(result);
549} 549}
550 550
551static int acpi_driver_attach(struct acpi_driver *drv) 551static void acpi_driver_attach(struct acpi_driver *drv)
552{ 552{
553 struct list_head *node, *next; 553 struct list_head *node, *next;
554 int count = 0;
555 554
556 ACPI_FUNCTION_TRACE("acpi_driver_attach"); 555 ACPI_FUNCTION_TRACE("acpi_driver_attach");
557 556
@@ -568,7 +567,6 @@ static int acpi_driver_attach(struct acpi_driver *drv)
568 if (!acpi_bus_driver_init(dev, drv)) { 567 if (!acpi_bus_driver_init(dev, drv)) {
569 acpi_start_single_object(dev); 568 acpi_start_single_object(dev);
570 atomic_inc(&drv->references); 569 atomic_inc(&drv->references);
571 count++;
572 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 570 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
573 "Found driver [%s] for device [%s]\n", 571 "Found driver [%s] for device [%s]\n",
574 drv->name, dev->pnp.bus_id)); 572 drv->name, dev->pnp.bus_id));
@@ -577,7 +575,6 @@ static int acpi_driver_attach(struct acpi_driver *drv)
577 spin_lock(&acpi_device_lock); 575 spin_lock(&acpi_device_lock);
578 } 576 }
579 spin_unlock(&acpi_device_lock); 577 spin_unlock(&acpi_device_lock);
580 return_VALUE(count);
581} 578}
582 579
583static int acpi_driver_detach(struct acpi_driver *drv) 580static int acpi_driver_detach(struct acpi_driver *drv)
@@ -610,14 +607,11 @@ static int acpi_driver_detach(struct acpi_driver *drv)
610 * @driver: driver being registered 607 * @driver: driver being registered
611 * 608 *
612 * Registers a driver with the ACPI bus. Searches the namespace for all 609 * Registers a driver with the ACPI bus. Searches the namespace for all
613 * devices that match the driver's criteria and binds. Returns the 610 * devices that match the driver's criteria and binds. Returns zero for
614 * number of devices that were claimed by the driver, or a negative 611 * success or a negative error status for failure.
615 * error status for failure.
616 */ 612 */
617int acpi_bus_register_driver(struct acpi_driver *driver) 613int acpi_bus_register_driver(struct acpi_driver *driver)
618{ 614{
619 int count;
620
621 ACPI_FUNCTION_TRACE("acpi_bus_register_driver"); 615 ACPI_FUNCTION_TRACE("acpi_bus_register_driver");
622 616
623 if (acpi_disabled) 617 if (acpi_disabled)
@@ -629,9 +623,9 @@ int acpi_bus_register_driver(struct acpi_driver *driver)
629 spin_lock(&acpi_device_lock); 623 spin_lock(&acpi_device_lock);
630 list_add_tail(&driver->node, &acpi_bus_drivers); 624 list_add_tail(&driver->node, &acpi_bus_drivers);
631 spin_unlock(&acpi_device_lock); 625 spin_unlock(&acpi_device_lock);
632 count = acpi_driver_attach(driver); 626 acpi_driver_attach(driver);
633 627
634 return_VALUE(count); 628 return_VALUE(0);
635} 629}
636 630
637EXPORT_SYMBOL(acpi_bus_register_driver); 631EXPORT_SYMBOL(acpi_bus_register_driver);