ACPI: Remove the arguments of acpi_bus_add() that are not used
Notice that acpi_bus_add() uses only 2 of its 4 arguments and redefine its header to match the body. Update all of its callers as necessary and observe that this leads to quite a number of removed lines of code (Linus will like that). Add a kerneldoc comment documenting acpi_bus_add() and wonder how its callers make wrong assumptions about the second argument (make note to self to take care of that later). 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:
@@ -157,34 +157,17 @@ static int
|
||||
acpi_memory_get_device(acpi_handle handle,
|
||||
struct acpi_memory_device **mem_device)
|
||||
{
|
||||
acpi_status status;
|
||||
acpi_handle phandle;
|
||||
struct acpi_device *device = NULL;
|
||||
struct acpi_device *pdevice = NULL;
|
||||
int result;
|
||||
|
||||
|
||||
if (!acpi_bus_get_device(handle, &device) && device)
|
||||
goto end;
|
||||
|
||||
status = acpi_get_parent(handle, &phandle);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
ACPI_EXCEPTION((AE_INFO, status, "Cannot find acpi parent"));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Get the parent device */
|
||||
result = acpi_bus_get_device(phandle, &pdevice);
|
||||
if (result) {
|
||||
acpi_handle_warn(phandle, "Cannot get acpi bus device\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now add the notified device. This creates the acpi_device
|
||||
* and invokes .add function
|
||||
*/
|
||||
result = acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE);
|
||||
result = acpi_bus_add(handle, &device);
|
||||
if (result) {
|
||||
acpi_handle_warn(handle, "Cannot add acpi bus\n");
|
||||
return -EINVAL;
|
||||
|
Reference in New Issue
Block a user