diff options
Diffstat (limited to 'drivers/pci/hotplug/pciehp_ctrl.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_ctrl.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index f1e0966cee95..b23061c56115 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c | |||
@@ -37,8 +37,6 @@ | |||
37 | #include "pciehp.h" | 37 | #include "pciehp.h" |
38 | 38 | ||
39 | static void interrupt_event_handler(struct work_struct *work); | 39 | static void interrupt_event_handler(struct work_struct *work); |
40 | static int pciehp_enable_slot(struct slot *p_slot); | ||
41 | static int pciehp_disable_slot(struct slot *p_slot); | ||
42 | 40 | ||
43 | static int queue_interrupt_event(struct slot *p_slot, u32 event_type) | 41 | static int queue_interrupt_event(struct slot *p_slot, u32 event_type) |
44 | { | 42 | { |
@@ -197,12 +195,6 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot) | |||
197 | __FUNCTION__); | 195 | __FUNCTION__); |
198 | return; | 196 | return; |
199 | } | 197 | } |
200 | /* | ||
201 | * After turning power off, we must wait for at least | ||
202 | * 1 second before taking any action that relies on | ||
203 | * power having been removed from the slot/adapter. | ||
204 | */ | ||
205 | msleep(1000); | ||
206 | } | 198 | } |
207 | } | 199 | } |
208 | 200 | ||
@@ -215,15 +207,12 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot) | |||
215 | */ | 207 | */ |
216 | static int board_added(struct slot *p_slot) | 208 | static int board_added(struct slot *p_slot) |
217 | { | 209 | { |
218 | u8 hp_slot; | ||
219 | int retval = 0; | 210 | int retval = 0; |
220 | struct controller *ctrl = p_slot->ctrl; | 211 | struct controller *ctrl = p_slot->ctrl; |
221 | 212 | ||
222 | hp_slot = p_slot->device - ctrl->slot_device_offset; | ||
223 | |||
224 | dbg("%s: slot device, slot offset, hp slot = %d, %d ,%d\n", | 213 | dbg("%s: slot device, slot offset, hp slot = %d, %d ,%d\n", |
225 | __FUNCTION__, p_slot->device, | 214 | __FUNCTION__, p_slot->device, |
226 | ctrl->slot_device_offset, hp_slot); | 215 | ctrl->slot_device_offset, p_slot->hp_slot); |
227 | 216 | ||
228 | if (POWER_CTRL(ctrl->ctrlcap)) { | 217 | if (POWER_CTRL(ctrl->ctrlcap)) { |
229 | /* Power on slot */ | 218 | /* Power on slot */ |
@@ -281,8 +270,6 @@ err_exit: | |||
281 | */ | 270 | */ |
282 | static int remove_board(struct slot *p_slot) | 271 | static int remove_board(struct slot *p_slot) |
283 | { | 272 | { |
284 | u8 device; | ||
285 | u8 hp_slot; | ||
286 | int retval = 0; | 273 | int retval = 0; |
287 | struct controller *ctrl = p_slot->ctrl; | 274 | struct controller *ctrl = p_slot->ctrl; |
288 | 275 | ||
@@ -290,11 +277,7 @@ static int remove_board(struct slot *p_slot) | |||
290 | if (retval) | 277 | if (retval) |
291 | return retval; | 278 | return retval; |
292 | 279 | ||
293 | device = p_slot->device; | 280 | dbg("In %s, hp_slot = %d\n", __FUNCTION__, p_slot->hp_slot); |
294 | hp_slot = p_slot->device - ctrl->slot_device_offset; | ||
295 | p_slot = pciehp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); | ||
296 | |||
297 | dbg("In %s, hp_slot = %d\n", __FUNCTION__, hp_slot); | ||
298 | 281 | ||
299 | if (POWER_CTRL(ctrl->ctrlcap)) { | 282 | if (POWER_CTRL(ctrl->ctrlcap)) { |
300 | /* power off slot */ | 283 | /* power off slot */ |
@@ -621,12 +604,6 @@ int pciehp_disable_slot(struct slot *p_slot) | |||
621 | mutex_unlock(&p_slot->ctrl->crit_sect); | 604 | mutex_unlock(&p_slot->ctrl->crit_sect); |
622 | return -EINVAL; | 605 | return -EINVAL; |
623 | } | 606 | } |
624 | /* | ||
625 | * After turning power off, we must wait for at least | ||
626 | * 1 second before taking any action that relies on | ||
627 | * power having been removed from the slot/adapter. | ||
628 | */ | ||
629 | msleep(1000); | ||
630 | } | 607 | } |
631 | 608 | ||
632 | ret = remove_board(p_slot); | 609 | ret = remove_board(p_slot); |