diff options
Diffstat (limited to 'drivers/pci/hotplug/cpqphp_pci.c')
-rw-r--r-- | drivers/pci/hotplug/cpqphp_pci.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c index 6e4a12c91adb..a3e3c2002b58 100644 --- a/drivers/pci/hotplug/cpqphp_pci.c +++ b/drivers/pci/hotplug/cpqphp_pci.c | |||
@@ -86,6 +86,8 @@ int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func) | |||
86 | struct pci_bus *child; | 86 | struct pci_bus *child; |
87 | int num; | 87 | int num; |
88 | 88 | ||
89 | pci_lock_rescan_remove(); | ||
90 | |||
89 | if (func->pci_dev == NULL) | 91 | if (func->pci_dev == NULL) |
90 | func->pci_dev = pci_get_bus_and_slot(func->bus,PCI_DEVFN(func->device, func->function)); | 92 | func->pci_dev = pci_get_bus_and_slot(func->bus,PCI_DEVFN(func->device, func->function)); |
91 | 93 | ||
@@ -100,7 +102,7 @@ int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func) | |||
100 | func->pci_dev = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, func->function)); | 102 | func->pci_dev = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, func->function)); |
101 | if (func->pci_dev == NULL) { | 103 | if (func->pci_dev == NULL) { |
102 | dbg("ERROR: pci_dev still null\n"); | 104 | dbg("ERROR: pci_dev still null\n"); |
103 | return 0; | 105 | goto out; |
104 | } | 106 | } |
105 | } | 107 | } |
106 | 108 | ||
@@ -113,6 +115,8 @@ int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func) | |||
113 | 115 | ||
114 | pci_dev_put(func->pci_dev); | 116 | pci_dev_put(func->pci_dev); |
115 | 117 | ||
118 | out: | ||
119 | pci_unlock_rescan_remove(); | ||
116 | return 0; | 120 | return 0; |
117 | } | 121 | } |
118 | 122 | ||
@@ -123,6 +127,7 @@ int cpqhp_unconfigure_device(struct pci_func* func) | |||
123 | 127 | ||
124 | dbg("%s: bus/dev/func = %x/%x/%x\n", __func__, func->bus, func->device, func->function); | 128 | dbg("%s: bus/dev/func = %x/%x/%x\n", __func__, func->bus, func->device, func->function); |
125 | 129 | ||
130 | pci_lock_rescan_remove(); | ||
126 | for (j=0; j<8 ; j++) { | 131 | for (j=0; j<8 ; j++) { |
127 | struct pci_dev* temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j)); | 132 | struct pci_dev* temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j)); |
128 | if (temp) { | 133 | if (temp) { |
@@ -130,6 +135,7 @@ int cpqhp_unconfigure_device(struct pci_func* func) | |||
130 | pci_stop_and_remove_bus_device(temp); | 135 | pci_stop_and_remove_bus_device(temp); |
131 | } | 136 | } |
132 | } | 137 | } |
138 | pci_unlock_rescan_remove(); | ||
133 | return 0; | 139 | return 0; |
134 | } | 140 | } |
135 | 141 | ||