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>
This commit is contained in:
parent
47525cda88
commit
02f57c67a8
@ -139,24 +139,14 @@ static int container_device_add(struct acpi_device **device, acpi_handle handle)
|
|||||||
{
|
{
|
||||||
acpi_handle phandle;
|
acpi_handle phandle;
|
||||||
struct acpi_device *pdev;
|
struct acpi_device *pdev;
|
||||||
int result;
|
|
||||||
|
|
||||||
|
if (acpi_get_parent(handle, &phandle))
|
||||||
if (acpi_get_parent(handle, &phandle)) {
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
|
||||||
|
|
||||||
if (acpi_bus_get_device(phandle, &pdev)) {
|
if (acpi_bus_get_device(phandle, &pdev))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
|
||||||
|
|
||||||
if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) {
|
return acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE);
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
result = acpi_bus_start(*device);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void container_notify_cb(acpi_handle handle, u32 type, void *context)
|
static void container_notify_cb(acpi_handle handle, u32 type, void *context)
|
||||||
|
@ -571,7 +571,6 @@ static void acpi_device_remove_notify_handler(struct acpi_device *device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int acpi_bus_driver_init(struct acpi_device *, struct acpi_driver *);
|
static int acpi_bus_driver_init(struct acpi_device *, struct acpi_driver *);
|
||||||
static int acpi_start_single_object(struct acpi_device *);
|
|
||||||
static int acpi_device_probe(struct device * dev)
|
static int acpi_device_probe(struct device * dev)
|
||||||
{
|
{
|
||||||
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
struct acpi_device *acpi_dev = to_acpi_device(dev);
|
||||||
@ -580,9 +579,6 @@ static int acpi_device_probe(struct device * dev)
|
|||||||
|
|
||||||
ret = acpi_bus_driver_init(acpi_dev, acpi_drv);
|
ret = acpi_bus_driver_init(acpi_dev, acpi_drv);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
if (acpi_dev->add_type == ACPI_BUS_ADD_START)
|
|
||||||
acpi_start_single_object(acpi_dev);
|
|
||||||
|
|
||||||
if (acpi_drv->ops.notify) {
|
if (acpi_drv->ops.notify) {
|
||||||
ret = acpi_device_install_notify_handler(acpi_dev);
|
ret = acpi_device_install_notify_handler(acpi_dev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
@ -761,24 +757,6 @@ acpi_bus_driver_init(struct acpi_device *device, struct acpi_driver *driver)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int acpi_start_single_object(struct acpi_device *device)
|
|
||||||
{
|
|
||||||
int result = 0;
|
|
||||||
struct acpi_driver *driver;
|
|
||||||
|
|
||||||
|
|
||||||
if (!(driver = device->driver))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (driver->ops.start) {
|
|
||||||
result = driver->ops.start(device);
|
|
||||||
if (result && driver->ops.remove)
|
|
||||||
driver->ops.remove(device, ACPI_BUS_REMOVAL_NORMAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* acpi_bus_register_driver - register a driver with the ACPI bus
|
* acpi_bus_register_driver - register a driver with the ACPI bus
|
||||||
* @driver: driver being registered
|
* @driver: driver being registered
|
||||||
@ -1673,59 +1651,31 @@ static int acpi_bus_scan(acpi_handle handle, bool start,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* acpi_bus_add and acpi_bus_start
|
* acpi_bus_add
|
||||||
*
|
*
|
||||||
* scan a given ACPI tree and (probably recently hot-plugged)
|
* scan a given ACPI tree and (probably recently hot-plugged)
|
||||||
* create and add or starts found devices.
|
* create and add found devices.
|
||||||
*
|
*
|
||||||
* If no devices were found -ENODEV is returned which does not
|
* If no devices were found -ENODEV is returned which does not
|
||||||
* mean that this is a real error, there just have been no suitable
|
* mean that this is a real error, there just have been no suitable
|
||||||
* ACPI objects in the table trunk from which the kernel could create
|
* ACPI objects in the table trunk from which the kernel could create
|
||||||
* a device and add/start an appropriate driver.
|
* a device and add an appropriate driver.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
acpi_bus_add(struct acpi_device **child,
|
acpi_bus_add(struct acpi_device **child,
|
||||||
struct acpi_device *parent, acpi_handle handle, int type)
|
struct acpi_device *parent, acpi_handle handle, int type)
|
||||||
{
|
{
|
||||||
return acpi_bus_scan(handle, false, child);
|
int err;
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(acpi_bus_add);
|
|
||||||
|
|
||||||
static acpi_status acpi_bus_start_device(acpi_handle handle, u32 lvl,
|
err = acpi_bus_scan(handle, false, child);
|
||||||
void *not_used, void **ret_not_used)
|
if (err)
|
||||||
{
|
return err;
|
||||||
struct acpi_device *device;
|
|
||||||
unsigned long long sta_not_used;
|
|
||||||
int type_not_used;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Ignore errors ignored by acpi_bus_check_add() to avoid terminating
|
|
||||||
* namespace walks prematurely.
|
|
||||||
*/
|
|
||||||
if (acpi_bus_type_and_status(handle, &type_not_used, &sta_not_used))
|
|
||||||
return AE_OK;
|
|
||||||
|
|
||||||
if (acpi_bus_get_device(handle, &device))
|
|
||||||
return AE_CTRL_DEPTH;
|
|
||||||
|
|
||||||
return acpi_start_single_object(device);
|
|
||||||
}
|
|
||||||
|
|
||||||
int acpi_bus_start(struct acpi_device *device)
|
|
||||||
{
|
|
||||||
if (!device)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
if (ACPI_SUCCESS(acpi_start_single_object(device)))
|
|
||||||
acpi_walk_namespace(ACPI_TYPE_ANY, device->handle,
|
|
||||||
ACPI_UINT32_MAX, acpi_bus_start_device,
|
|
||||||
NULL, NULL, NULL);
|
|
||||||
|
|
||||||
acpi_update_all_gpes();
|
acpi_update_all_gpes();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(acpi_bus_start);
|
EXPORT_SYMBOL(acpi_bus_add);
|
||||||
|
|
||||||
int acpi_bus_trim(struct acpi_device *start, int rmdevice)
|
int acpi_bus_trim(struct acpi_device *start, int rmdevice)
|
||||||
{
|
{
|
||||||
|
@ -759,7 +759,6 @@ static int acpiphp_bus_add(struct acpiphp_func *func)
|
|||||||
-ret_val);
|
-ret_val);
|
||||||
goto acpiphp_bus_add_out;
|
goto acpiphp_bus_add_out;
|
||||||
}
|
}
|
||||||
ret_val = acpi_bus_start(device);
|
|
||||||
|
|
||||||
acpiphp_bus_add_out:
|
acpiphp_bus_add_out:
|
||||||
return ret_val;
|
return ret_val;
|
||||||
@ -1148,8 +1147,7 @@ static void handle_bridge_insertion(acpi_handle handle, u32 type)
|
|||||||
err("cannot add bridge to acpi list\n");
|
err("cannot add bridge to acpi list\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!acpiphp_configure_bridge(handle) &&
|
if (!acpiphp_configure_bridge(handle))
|
||||||
!acpi_bus_start(device))
|
|
||||||
add_bridge(handle);
|
add_bridge(handle);
|
||||||
else
|
else
|
||||||
err("cannot configure and start bridge\n");
|
err("cannot configure and start bridge\n");
|
||||||
|
@ -457,8 +457,6 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
|
|||||||
ret, (int)(adr>>16),
|
ret, (int)(adr>>16),
|
||||||
(int)(adr&0xffff));
|
(int)(adr&0xffff));
|
||||||
/* try to continue on */
|
/* try to continue on */
|
||||||
} else {
|
|
||||||
acpi_bus_start(device);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -362,7 +362,6 @@ int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent,
|
|||||||
acpi_handle handle, int type);
|
acpi_handle handle, int type);
|
||||||
void acpi_bus_hot_remove_device(void *context);
|
void acpi_bus_hot_remove_device(void *context);
|
||||||
int acpi_bus_trim(struct acpi_device *start, int rmdevice);
|
int acpi_bus_trim(struct acpi_device *start, int rmdevice);
|
||||||
int acpi_bus_start(struct acpi_device *device);
|
|
||||||
acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
|
acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
|
||||||
int acpi_match_device_ids(struct acpi_device *device,
|
int acpi_match_device_ids(struct acpi_device *device,
|
||||||
const struct acpi_device_id *ids);
|
const struct acpi_device_id *ids);
|
||||||
|
Loading…
Reference in New Issue
Block a user