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:
@@ -734,15 +734,9 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
|
||||
*/
|
||||
static int acpiphp_bus_add(struct acpiphp_func *func)
|
||||
{
|
||||
acpi_handle phandle;
|
||||
struct acpi_device *device, *pdevice;
|
||||
struct acpi_device *device;
|
||||
int ret_val;
|
||||
|
||||
acpi_get_parent(func->handle, &phandle);
|
||||
if (acpi_bus_get_device(phandle, &pdevice)) {
|
||||
dbg("no parent device, assuming NULL\n");
|
||||
pdevice = NULL;
|
||||
}
|
||||
if (!acpi_bus_get_device(func->handle, &device)) {
|
||||
dbg("bus exists... trim\n");
|
||||
/* this shouldn't be in here, so remove
|
||||
@@ -752,8 +746,7 @@ static int acpiphp_bus_add(struct acpiphp_func *func)
|
||||
dbg("acpi_bus_trim return %x\n", ret_val);
|
||||
}
|
||||
|
||||
ret_val = acpi_bus_add(&device, pdevice, func->handle,
|
||||
ACPI_BUS_TYPE_DEVICE);
|
||||
ret_val = acpi_bus_add(func->handle, &device);
|
||||
if (ret_val) {
|
||||
dbg("error adding bus, %x\n",
|
||||
-ret_val);
|
||||
@@ -1129,8 +1122,7 @@ static int acpiphp_configure_bridge (acpi_handle handle)
|
||||
|
||||
static void handle_bridge_insertion(acpi_handle handle, u32 type)
|
||||
{
|
||||
struct acpi_device *device, *pdevice;
|
||||
acpi_handle phandle;
|
||||
struct acpi_device *device;
|
||||
|
||||
if ((type != ACPI_NOTIFY_BUS_CHECK) &&
|
||||
(type != ACPI_NOTIFY_DEVICE_CHECK)) {
|
||||
@@ -1138,12 +1130,7 @@ static void handle_bridge_insertion(acpi_handle handle, u32 type)
|
||||
return;
|
||||
}
|
||||
|
||||
acpi_get_parent(handle, &phandle);
|
||||
if (acpi_bus_get_device(phandle, &pdevice)) {
|
||||
dbg("no parent device, assuming NULL\n");
|
||||
pdevice = NULL;
|
||||
}
|
||||
if (acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE)) {
|
||||
if (acpi_bus_add(handle, &device)) {
|
||||
err("cannot add bridge to acpi list\n");
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user