aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2013-01-10 13:18:41 -0500
committerBjorn Helgaas <bhelgaas@google.com>2013-01-10 13:18:41 -0500
commit295a7f6235bfa21be3454aebc1bea1eaf0b74fb7 (patch)
treeae253b12eb331e1d093a3f348b4f8045e80f5e53 /drivers/pci/hotplug
parentb3e65e1f9185a2eb034defe4270ba178ba70b9a9 (diff)
parentf95988de06ea62ef5bd861f06e9ef56cea405ed1 (diff)
Merge branch 'acpi-scan' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm into pci/yinghai-survey-resources+acpi-scan
* 'acpi-scan' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / scan: Treat power resources in a special way ACPI: Remove unused struct acpi_pci_root.id member ACPI: Drop ACPI device .bind() and .unbind() callbacks ACPI / PCI: Move the _PRT setup and cleanup code to pci-acpi.c ACPI / PCI: Rework the setup and cleanup of device wakeup ACPI: Add .setup() and .cleanup() callbacks to struct acpi_bus_type ACPI: Make acpi_bus_scan() and acpi_bus_add() take only one argument ACPI: Replace ACPI device add_type field with a match_driver flag ACPI: Drop the second argument of acpi_bus_scan() ACPI: Remove the arguments of acpi_bus_add() that are not used ACPI: Remove acpi_start_single_object() and acpi_bus_start() ACPI / PCI: Fold acpi_pci_root_start() into acpi_pci_root_add() ACPI: Change the ordering of acpi_bus_check_add() ACPI: Replace struct acpi_bus_ops with enum type ACPI: Reduce the usage of struct acpi_bus_ops ACPI: Make acpi_bus_add() and acpi_bus_start() visibly different ACPI: Change the ordering of PCI root bridge driver registrarion ACPI: Separate adding ACPI device objects from probing ACPI drivers Conflicts: drivers/acpi/pci_root.c
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c40
-rw-r--r--drivers/pci/hotplug/sgi_hotplug.c6
2 files changed, 15 insertions, 31 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 3d6d4fd1e3c5..91b5ad875c53 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,16 +746,13 @@ 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);
756 ACPI_BUS_TYPE_DEVICE); 750 if (!ret_val)
757 if (ret_val) { 751 ret_val = acpi_bus_get_device(func->handle, &device);
758 dbg("error adding bus, %x\n", 752
759 -ret_val); 753 if (ret_val)
760 goto acpiphp_bus_add_out; 754 dbg("error adding bus, %x\n", -ret_val);
761 }
762 ret_val = acpi_bus_start(device);
763 755
764acpiphp_bus_add_out:
765 return ret_val; 756 return ret_val;
766} 757}
767 758
@@ -1130,8 +1121,7 @@ static int acpiphp_configure_bridge (acpi_handle handle)
1130 1121
1131static void handle_bridge_insertion(acpi_handle handle, u32 type) 1122static void handle_bridge_insertion(acpi_handle handle, u32 type)
1132{ 1123{
1133 struct acpi_device *device, *pdevice; 1124 struct acpi_device *device;
1134 acpi_handle phandle;
1135 1125
1136 if ((type != ACPI_NOTIFY_BUS_CHECK) && 1126 if ((type != ACPI_NOTIFY_BUS_CHECK) &&
1137 (type != ACPI_NOTIFY_DEVICE_CHECK)) { 1127 (type != ACPI_NOTIFY_DEVICE_CHECK)) {
@@ -1139,17 +1129,15 @@ static void handle_bridge_insertion(acpi_handle handle, u32 type)
1139 return; 1129 return;
1140 } 1130 }
1141 1131
1142 acpi_get_parent(handle, &phandle); 1132 if (acpi_bus_add(handle)) {
1143 if (acpi_bus_get_device(phandle, &pdevice)) {
1144 dbg("no parent device, assuming NULL\n");
1145 pdevice = NULL;
1146 }
1147 if (acpi_bus_add(&device, pdevice, handle, ACPI_BUS_TYPE_DEVICE)) {
1148 err("cannot add bridge to acpi list\n"); 1133 err("cannot add bridge to acpi list\n");
1149 return; 1134 return;
1150 } 1135 }
1151 if (!acpiphp_configure_bridge(handle) && 1136 if (acpi_bus_get_device(handle, &device)) {
1152 !acpi_bus_start(device)) 1137 err("ACPI device object missing\n");
1138 return;
1139 }
1140 if (!acpiphp_configure_bridge(handle))
1153 add_bridge(handle); 1141 add_bridge(handle);
1154 else 1142 else
1155 err("cannot configure and start bridge\n"); 1143 err("cannot configure and start bridge\n");
diff --git a/drivers/pci/hotplug/sgi_hotplug.c b/drivers/pci/hotplug/sgi_hotplug.c
index f64ca92253da..f3c419256d2a 100644
--- a/drivers/pci/hotplug/sgi_hotplug.c
+++ b/drivers/pci/hotplug/sgi_hotplug.c
@@ -412,7 +412,6 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
412 if (SN_ACPI_BASE_SUPPORT() && ssdt) { 412 if (SN_ACPI_BASE_SUPPORT() && ssdt) {
413 unsigned long long adr; 413 unsigned long long adr;
414 struct acpi_device *pdevice; 414 struct acpi_device *pdevice;
415 struct acpi_device *device;
416 acpi_handle phandle; 415 acpi_handle phandle;
417 acpi_handle chandle = NULL; 416 acpi_handle chandle = NULL;
418 acpi_handle rethandle; 417 acpi_handle rethandle;
@@ -448,8 +447,7 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
448 if (ACPI_SUCCESS(ret) && 447 if (ACPI_SUCCESS(ret) &&
449 (adr>>16) == (slot->device_num + 1)) { 448 (adr>>16) == (slot->device_num + 1)) {
450 449
451 ret = acpi_bus_add(&device, pdevice, chandle, 450 ret = acpi_bus_add(chandle);
452 ACPI_BUS_TYPE_DEVICE);
453 if (ACPI_FAILURE(ret)) { 451 if (ACPI_FAILURE(ret)) {
454 printk(KERN_ERR "%s: acpi_bus_add " 452 printk(KERN_ERR "%s: acpi_bus_add "
455 "failed (0x%x) for slot %d " 453 "failed (0x%x) for slot %d "
@@ -457,8 +455,6 @@ static int enable_slot(struct hotplug_slot *bss_hotplug_slot)
457 ret, (int)(adr>>16), 455 ret, (int)(adr>>16),
458 (int)(adr&0xffff)); 456 (int)(adr&0xffff));
459 /* try to continue on */ 457 /* try to continue on */
460 } else {
461 acpi_bus_start(device);
462 } 458 }
463 } 459 }
464 } 460 }