aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-12-20 18:36:47 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-03 07:09:39 -0500
commit636458de36f1fb4cdd318387d2f45604e451b17a (patch)
tree484db3b8ea7d4d9cba63422654d790880908a1b6 /drivers/pci/hotplug
parent02f57c67a8677ae55dcdd256a2a7abaf41e4cc1f (diff)
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>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c21
-rw-r--r--drivers/pci/hotplug/sgi_hotplug.c3
2 files changed, 5 insertions, 19 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 7e2bad4c2fcc..dfc2df54b93a 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -734,15 +734,9 @@ static unsigned char acpiphp_max_busnr(struct pci_bus *bus)
734 */ 734 */
735static int acpiphp_bus_add(struct acpiphp_func *func) 735static int acpiphp_bus_add(struct acpiphp_func *func)
736{ 736{
737 acpi_handle phandle; 737 struct acpi_device *device;
738 struct acpi_device *device, *pdevice;
739 int ret_val; 738 int ret_val;
740 739
741 acpi_get_parent(func->handle, &phandle);
742 if (acpi_bus_get_device(phandle, &pdevice)) {
743 dbg("no parent device, assuming NULL\n");
744 pdevice = NULL;
745 }
746 if (!acpi_bus_get_device(func->handle, &device)) { 740 if (!acpi_bus_get_device(func->handle, &device)) {
747 dbg("bus exists... trim\n"); 741 dbg("bus exists... trim\n");
748 /* this shouldn't be in here, so remove 742 /* this shouldn't be in here, so remove
@@ -752,8 +746,7 @@ static int acpiphp_bus_add(struct acpiphp_func *func)
752 dbg("acpi_bus_trim return %x\n", ret_val); 746 dbg("acpi_bus_trim return %x\n", ret_val);
753 } 747 }
754 748
755 ret_val = acpi_bus_add(&device, pdevice, func->handle, 749 ret_val = acpi_bus_add(func->handle, &device);
756 ACPI_BUS_TYPE_DEVICE);
757 if (ret_val) { 750 if (ret_val) {
758 dbg("error adding bus, %x\n", 751 dbg("error adding bus, %x\n",
759 -ret_val); 752 -ret_val);
@@ -1129,8 +1122,7 @@ static int acpiphp_configure_bridge (acpi_handle handle)
1129 1122
1130static void handle_bridge_insertion(acpi_handle handle, u32 type) 1123static void handle_bridge_insertion(acpi_handle handle, u32 type)
1131{ 1124{
1132 struct acpi_device *device, *pdevice; 1125 struct acpi_device *device;
1133 acpi_handle phandle;
1134 1126
1135 if ((type != ACPI_NOTIFY_BUS_CHECK) && 1127 if ((type != ACPI_NOTIFY_BUS_CHECK) &&
1136 (type != ACPI_NOTIFY_DEVICE_CHECK)) { 1128 (type != ACPI_NOTIFY_DEVICE_CHECK)) {
@@ -1138,12 +1130,7 @@ static void handle_bridge_insertion(acpi_handle handle, u32 type)
1138 return; 1130 return;
1139 } 1131 }
1140 1132
1141 acpi_get_parent(handle, &phandle); 1133 if (acpi_bus_add(handle, &device)) {
1142 if (acpi_bus_get_device(phandle, &pdevice)) {
1143 dbg("no parent device, assuming NULL\n");
1144 pdevice = NULL;
1145 }
1146 if (acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE)) {
1147 err("cannot add bridge to acpi list\n"); 1134 err("cannot add bridge to acpi list\n");
1148 return; 1135 return;
1149 } 1136 }
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
index 20c960d5317d..801b58d1f78e 100644
--- a/drivers/pci/hotplug/sgi_hotplug.c
+++ b/drivers/pci/hotplug/sgi_hotplug.c
@@ -448,8 +448,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
448 if (ACPI_SUCCESS(ret) && 448 if (ACPI_SUCCESS(ret) &&
449 (adr>>16) == (slot->device_num + 1)) { 449 (adr>>16) == (slot->device_num + 1)) {
450 450
451 ret = acpi_bus_add(&device, pdevice, chandle, 451 ret = acpi_bus_add(chandle, &device);
452 ACPI_BUS_TYPE_DEVICE);
453 if (ACPI_FAILURE(ret)) { 452 if (ACPI_FAILURE(ret)) {
454 printk(KERN_ERR "%s: acpi_bus_add " 453 printk(KERN_ERR "%s: acpi_bus_add "
455 "failed (0x%x) for slot %d " 454 "failed (0x%x) for slot %d "