aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-12-20 18:36:46 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-03 07:09:39 -0500
commit02f57c67a8677ae55dcdd256a2a7abaf41e4cc1f (patch)
treede2b6f73409a459119641fd8359694f0367f8f50 /drivers/acpi/scan.c
parent47525cda88f5cc4dbe24de1cc05617c08e2d7c4a (diff)
ACPI: Remove acpi_start_single_object() and acpi_bus_start()
The ACPI PCI root bridge driver was the only ACPI driver implementing the .start() callback, which isn't used by any ACPI drivers any more now. For this reason, acpi_start_single_object() has no purpose any more, so remove it and all references to it. Also remove acpi_bus_start_device(), whose only purpose was to call acpi_start_single_object(). Moreover, since after the removal of acpi_bus_start_device() the only purpose of acpi_bus_start() remains to call acpi_update_all_gpes(), move that into acpi_bus_add() and drop acpi_bus_start() too, remove its header from acpi_bus.h and update all of its former users accordingly. This change was previously proposed in a different from by Yinghai Lu. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Yinghai Lu <yinghai@kernel.org> Acked-by: Toshi Kani <toshi.kani@hp.com>
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c66
1 files changed, 8 insertions, 58 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index eb7ecb1f2032..6321cab4e5ff 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -571,7 +571,6 @@ static void acpi_device_remove_notify_handler(struct acpi_device *device)
571} 571}
572 572
573static int acpi_bus_driver_init(struct acpi_device *, struct acpi_driver *); 573static int acpi_bus_driver_init(struct acpi_device *, struct acpi_driver *);
574static int acpi_start_single_object(struct acpi_device *);
575static int acpi_device_probe(struct device * dev) 574static int acpi_device_probe(struct device * dev)
576{ 575{
577 struct acpi_device *acpi_dev = to_acpi_device(dev); 576 struct acpi_device *acpi_dev = to_acpi_device(dev);
@@ -580,9 +579,6 @@ static int acpi_device_probe(struct device * dev)
580 579
581 ret = acpi_bus_driver_init(acpi_dev, acpi_drv); 580 ret = acpi_bus_driver_init(acpi_dev, acpi_drv);
582 if (!ret) { 581 if (!ret) {
583 if (acpi_dev->add_type == ACPI_BUS_ADD_START)
584 acpi_start_single_object(acpi_dev);
585
586 if (acpi_drv->ops.notify) { 582 if (acpi_drv->ops.notify) {
587 ret = acpi_device_install_notify_handler(acpi_dev); 583 ret = acpi_device_install_notify_handler(acpi_dev);
588 if (ret) { 584 if (ret) {
@@ -761,24 +757,6 @@ acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver)
761 return 0; 757 return 0;
762} 758}
763 759
764static int acpi_start_single_object(struct acpi_device *device)
765{
766 int result = 0;
767 struct acpi_driver *driver;
768
769
770 if (!(driver = device->driver))
771 return 0;
772
773 if (driver->ops.start) {
774 result = driver->ops.start(device);
775 if (result && driver->ops.remove)
776 driver->ops.remove(device, ACPI_BUS_REMOVAL_NORMAL);
777 }
778
779 return result;
780}
781
782/** 760/**
783 * acpi_bus_register_driver - register a driver with the ACPI bus 761 * acpi_bus_register_driver - register a driver with the ACPI bus
784 * @driver: driver being registered 762 * @driver: driver being registered
@@ -1673,59 +1651,31 @@ static int acpi_bus_scan(acpi_handle handle, bool start,
1673} 1651}
1674 1652
1675/* 1653/*
1676 * acpi_bus_add and acpi_bus_start 1654 * acpi_bus_add
1677 * 1655 *
1678 * scan a given ACPI tree and (probably recently hot-plugged) 1656 * scan a given ACPI tree and (probably recently hot-plugged)
1679 * create and add or starts found devices. 1657 * create and add found devices.
1680 * 1658 *
1681 * If no devices were found -ENODEV is returned which does not 1659 * If no devices were found -ENODEV is returned which does not
1682 * mean that this is a real error, there just have been no suitable 1660 * mean that this is a real error, there just have been no suitable
1683 * ACPI objects in the table trunk from which the kernel could create 1661 * ACPI objects in the table trunk from which the kernel could create
1684 * a device and add/start an appropriate driver. 1662 * a device and add an appropriate driver.
1685 */ 1663 */
1686 1664
1687int 1665int
1688acpi_bus_add(struct acpi_device **child, 1666acpi_bus_add(struct acpi_device **child,
1689 struct acpi_device *parent, acpi_handle handle, int type) 1667 struct acpi_device *parent, acpi_handle handle, int type)
1690{ 1668{
1691 return acpi_bus_scan(handle, false, child); 1669 int err;
1692}
1693EXPORT_SYMBOL(acpi_bus_add);
1694
1695static acpi_status acpi_bus_start_device(acpi_handle handle, u32 lvl,
1696 void *not_used, void **ret_not_used)
1697{
1698 struct acpi_device *device;
1699 unsigned long long sta_not_used;
1700 int type_not_used;
1701
1702 /*
1703 * Ignore errors ignored by acpi_bus_check_add() to avoid terminating
1704 * namespace walks prematurely.
1705 */
1706 if (acpi_bus_type_and_status(handle, &type_not_used, &sta_not_used))
1707 return AE_OK;
1708
1709 if (acpi_bus_get_device(handle, &device))
1710 return AE_CTRL_DEPTH;
1711
1712 return acpi_start_single_object(device);
1713}
1714
1715int acpi_bus_start(struct acpi_device *device)
1716{
1717 if (!device)
1718 return -EINVAL;
1719 1670
1720 if (ACPI_SUCCESS(acpi_start_single_object(device))) 1671 err = acpi_bus_scan(handle, false, child);
1721 acpi_walk_namespace(ACPI_TYPE_ANY, device->handle, 1672 if (err)
1722 ACPI_UINT32_MAX, acpi_bus_start_device, 1673 return err;
1723 NULL, NULL, NULL);
1724 1674
1725 acpi_update_all_gpes(); 1675 acpi_update_all_gpes();
1726 return 0; 1676 return 0;
1727} 1677}
1728EXPORT_SYMBOL(acpi_bus_start); 1678EXPORT_SYMBOL(acpi_bus_add);
1729 1679
1730int acpi_bus_trim(struct acpi_device *start, int rmdevice) 1680int acpi_bus_trim(struct acpi_device *start, int rmdevice)
1731{ 1681{