diff options
Diffstat (limited to 'drivers/pci/hotplug/shpchp_ctrl.c')
-rw-r--r-- | drivers/pci/hotplug/shpchp_ctrl.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c index eb5cac6f08ae..dfb53932dfbc 100644 --- a/drivers/pci/hotplug/shpchp_ctrl.c +++ b/drivers/pci/hotplug/shpchp_ctrl.c | |||
@@ -91,7 +91,7 @@ u8 shpchp_handle_switch_change(u8 hp_slot, struct controller *ctrl) | |||
91 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); | 91 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); |
92 | p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); | 92 | p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); |
93 | p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); | 93 | p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); |
94 | dbg("%s: Card present %x Power status %x\n", __FUNCTION__, | 94 | dbg("%s: Card present %x Power status %x\n", __func__, |
95 | p_slot->presence_save, p_slot->pwr_save); | 95 | p_slot->presence_save, p_slot->pwr_save); |
96 | 96 | ||
97 | if (getstatus) { | 97 | if (getstatus) { |
@@ -191,10 +191,10 @@ static int change_bus_speed(struct controller *ctrl, struct slot *p_slot, | |||
191 | { | 191 | { |
192 | int rc = 0; | 192 | int rc = 0; |
193 | 193 | ||
194 | dbg("%s: change to speed %d\n", __FUNCTION__, speed); | 194 | dbg("%s: change to speed %d\n", __func__, speed); |
195 | if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, speed))) { | 195 | if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, speed))) { |
196 | err("%s: Issue of set bus speed mode command failed\n", | 196 | err("%s: Issue of set bus speed mode command failed\n", |
197 | __FUNCTION__); | 197 | __func__); |
198 | return WRONG_BUS_FREQUENCY; | 198 | return WRONG_BUS_FREQUENCY; |
199 | } | 199 | } |
200 | return rc; | 200 | return rc; |
@@ -213,7 +213,7 @@ static int fix_bus_speed(struct controller *ctrl, struct slot *pslot, | |||
213 | if (flag) { | 213 | if (flag) { |
214 | if (asp < bsp) { | 214 | if (asp < bsp) { |
215 | err("%s: speed of bus %x and adapter %x mismatch\n", | 215 | err("%s: speed of bus %x and adapter %x mismatch\n", |
216 | __FUNCTION__, bsp, asp); | 216 | __func__, bsp, asp); |
217 | rc = WRONG_BUS_FREQUENCY; | 217 | rc = WRONG_BUS_FREQUENCY; |
218 | } | 218 | } |
219 | return rc; | 219 | return rc; |
@@ -247,13 +247,13 @@ static int board_added(struct slot *p_slot) | |||
247 | hp_slot = p_slot->device - ctrl->slot_device_offset; | 247 | hp_slot = p_slot->device - ctrl->slot_device_offset; |
248 | 248 | ||
249 | dbg("%s: p_slot->device, slot_offset, hp_slot = %d, %d ,%d\n", | 249 | dbg("%s: p_slot->device, slot_offset, hp_slot = %d, %d ,%d\n", |
250 | __FUNCTION__, p_slot->device, | 250 | __func__, p_slot->device, |
251 | ctrl->slot_device_offset, hp_slot); | 251 | ctrl->slot_device_offset, hp_slot); |
252 | 252 | ||
253 | /* Power on slot without connecting to bus */ | 253 | /* Power on slot without connecting to bus */ |
254 | rc = p_slot->hpc_ops->power_on_slot(p_slot); | 254 | rc = p_slot->hpc_ops->power_on_slot(p_slot); |
255 | if (rc) { | 255 | if (rc) { |
256 | err("%s: Failed to power on slot\n", __FUNCTION__); | 256 | err("%s: Failed to power on slot\n", __func__); |
257 | return -1; | 257 | return -1; |
258 | } | 258 | } |
259 | 259 | ||
@@ -262,13 +262,13 @@ static int board_added(struct slot *p_slot) | |||
262 | return WRONG_BUS_FREQUENCY; | 262 | return WRONG_BUS_FREQUENCY; |
263 | 263 | ||
264 | if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, PCI_SPEED_33MHz))) { | 264 | if ((rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, PCI_SPEED_33MHz))) { |
265 | err("%s: Issue of set bus speed mode command failed\n", __FUNCTION__); | 265 | err("%s: Issue of set bus speed mode command failed\n", __func__); |
266 | return WRONG_BUS_FREQUENCY; | 266 | return WRONG_BUS_FREQUENCY; |
267 | } | 267 | } |
268 | 268 | ||
269 | /* turn on board, blink green LED, turn off Amber LED */ | 269 | /* turn on board, blink green LED, turn off Amber LED */ |
270 | if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { | 270 | if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { |
271 | err("%s: Issue of Slot Enable command failed\n", __FUNCTION__); | 271 | err("%s: Issue of Slot Enable command failed\n", __func__); |
272 | return rc; | 272 | return rc; |
273 | } | 273 | } |
274 | } | 274 | } |
@@ -276,19 +276,19 @@ static int board_added(struct slot *p_slot) | |||
276 | rc = p_slot->hpc_ops->get_adapter_speed(p_slot, &asp); | 276 | rc = p_slot->hpc_ops->get_adapter_speed(p_slot, &asp); |
277 | if (rc) { | 277 | if (rc) { |
278 | err("%s: Can't get adapter speed or bus mode mismatch\n", | 278 | err("%s: Can't get adapter speed or bus mode mismatch\n", |
279 | __FUNCTION__); | 279 | __func__); |
280 | return WRONG_BUS_FREQUENCY; | 280 | return WRONG_BUS_FREQUENCY; |
281 | } | 281 | } |
282 | 282 | ||
283 | rc = p_slot->hpc_ops->get_cur_bus_speed(p_slot, &bsp); | 283 | rc = p_slot->hpc_ops->get_cur_bus_speed(p_slot, &bsp); |
284 | if (rc) { | 284 | if (rc) { |
285 | err("%s: Can't get bus operation speed\n", __FUNCTION__); | 285 | err("%s: Can't get bus operation speed\n", __func__); |
286 | return WRONG_BUS_FREQUENCY; | 286 | return WRONG_BUS_FREQUENCY; |
287 | } | 287 | } |
288 | 288 | ||
289 | rc = p_slot->hpc_ops->get_max_bus_speed(p_slot, &msp); | 289 | rc = p_slot->hpc_ops->get_max_bus_speed(p_slot, &msp); |
290 | if (rc) { | 290 | if (rc) { |
291 | err("%s: Can't get max bus operation speed\n", __FUNCTION__); | 291 | err("%s: Can't get max bus operation speed\n", __func__); |
292 | msp = bsp; | 292 | msp = bsp; |
293 | } | 293 | } |
294 | 294 | ||
@@ -297,7 +297,7 @@ static int board_added(struct slot *p_slot) | |||
297 | slots_not_empty = 1; | 297 | slots_not_empty = 1; |
298 | 298 | ||
299 | dbg("%s: slots_not_empty %d, adapter_speed %d, bus_speed %d, " | 299 | dbg("%s: slots_not_empty %d, adapter_speed %d, bus_speed %d, " |
300 | "max_bus_speed %d\n", __FUNCTION__, slots_not_empty, asp, | 300 | "max_bus_speed %d\n", __func__, slots_not_empty, asp, |
301 | bsp, msp); | 301 | bsp, msp); |
302 | 302 | ||
303 | rc = fix_bus_speed(ctrl, p_slot, slots_not_empty, asp, bsp, msp); | 303 | rc = fix_bus_speed(ctrl, p_slot, slots_not_empty, asp, bsp, msp); |
@@ -306,18 +306,18 @@ static int board_added(struct slot *p_slot) | |||
306 | 306 | ||
307 | /* turn on board, blink green LED, turn off Amber LED */ | 307 | /* turn on board, blink green LED, turn off Amber LED */ |
308 | if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { | 308 | if ((rc = p_slot->hpc_ops->slot_enable(p_slot))) { |
309 | err("%s: Issue of Slot Enable command failed\n", __FUNCTION__); | 309 | err("%s: Issue of Slot Enable command failed\n", __func__); |
310 | return rc; | 310 | return rc; |
311 | } | 311 | } |
312 | 312 | ||
313 | /* Wait for ~1 second */ | 313 | /* Wait for ~1 second */ |
314 | msleep(1000); | 314 | msleep(1000); |
315 | 315 | ||
316 | dbg("%s: slot status = %x\n", __FUNCTION__, p_slot->status); | 316 | dbg("%s: slot status = %x\n", __func__, p_slot->status); |
317 | /* Check for a power fault */ | 317 | /* Check for a power fault */ |
318 | if (p_slot->status == 0xFF) { | 318 | if (p_slot->status == 0xFF) { |
319 | /* power fault occurred, but it was benign */ | 319 | /* power fault occurred, but it was benign */ |
320 | dbg("%s: power fault\n", __FUNCTION__); | 320 | dbg("%s: power fault\n", __func__); |
321 | rc = POWER_FAILURE; | 321 | rc = POWER_FAILURE; |
322 | p_slot->status = 0; | 322 | p_slot->status = 0; |
323 | goto err_exit; | 323 | goto err_exit; |
@@ -341,7 +341,7 @@ err_exit: | |||
341 | /* turn off slot, turn on Amber LED, turn off Green LED */ | 341 | /* turn off slot, turn on Amber LED, turn off Green LED */ |
342 | rc = p_slot->hpc_ops->slot_disable(p_slot); | 342 | rc = p_slot->hpc_ops->slot_disable(p_slot); |
343 | if (rc) { | 343 | if (rc) { |
344 | err("%s: Issue of Slot Disable command failed\n", __FUNCTION__); | 344 | err("%s: Issue of Slot Disable command failed\n", __func__); |
345 | return rc; | 345 | return rc; |
346 | } | 346 | } |
347 | 347 | ||
@@ -365,7 +365,7 @@ static int remove_board(struct slot *p_slot) | |||
365 | hp_slot = p_slot->device - ctrl->slot_device_offset; | 365 | hp_slot = p_slot->device - ctrl->slot_device_offset; |
366 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); | 366 | p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); |
367 | 367 | ||
368 | dbg("In %s, hp_slot = %d\n", __FUNCTION__, hp_slot); | 368 | dbg("In %s, hp_slot = %d\n", __func__, hp_slot); |
369 | 369 | ||
370 | /* Change status to shutdown */ | 370 | /* Change status to shutdown */ |
371 | if (p_slot->is_a_board) | 371 | if (p_slot->is_a_board) |
@@ -374,13 +374,13 @@ static int remove_board(struct slot *p_slot) | |||
374 | /* turn off slot, turn on Amber LED, turn off Green LED */ | 374 | /* turn off slot, turn on Amber LED, turn off Green LED */ |
375 | rc = p_slot->hpc_ops->slot_disable(p_slot); | 375 | rc = p_slot->hpc_ops->slot_disable(p_slot); |
376 | if (rc) { | 376 | if (rc) { |
377 | err("%s: Issue of Slot Disable command failed\n", __FUNCTION__); | 377 | err("%s: Issue of Slot Disable command failed\n", __func__); |
378 | return rc; | 378 | return rc; |
379 | } | 379 | } |
380 | 380 | ||
381 | rc = p_slot->hpc_ops->set_attention_status(p_slot, 0); | 381 | rc = p_slot->hpc_ops->set_attention_status(p_slot, 0); |
382 | if (rc) { | 382 | if (rc) { |
383 | err("%s: Issue of Set Attention command failed\n", __FUNCTION__); | 383 | err("%s: Issue of Set Attention command failed\n", __func__); |
384 | return rc; | 384 | return rc; |
385 | } | 385 | } |
386 | 386 | ||
@@ -439,7 +439,7 @@ void shpchp_queue_pushbutton_work(struct work_struct *work) | |||
439 | 439 | ||
440 | info = kmalloc(sizeof(*info), GFP_KERNEL); | 440 | info = kmalloc(sizeof(*info), GFP_KERNEL); |
441 | if (!info) { | 441 | if (!info) { |
442 | err("%s: Cannot allocate memory\n", __FUNCTION__); | 442 | err("%s: Cannot allocate memory\n", __func__); |
443 | return; | 443 | return; |
444 | } | 444 | } |
445 | info->p_slot = p_slot; | 445 | info->p_slot = p_slot; |
@@ -513,7 +513,7 @@ static void handle_button_press_event(struct slot *p_slot) | |||
513 | * expires to cancel hot-add or hot-remove | 513 | * expires to cancel hot-add or hot-remove |
514 | */ | 514 | */ |
515 | info("Button cancel on Slot(%s)\n", p_slot->name); | 515 | info("Button cancel on Slot(%s)\n", p_slot->name); |
516 | dbg("%s: button cancel\n", __FUNCTION__); | 516 | dbg("%s: button cancel\n", __func__); |
517 | cancel_delayed_work(&p_slot->work); | 517 | cancel_delayed_work(&p_slot->work); |
518 | if (p_slot->state == BLINKINGOFF_STATE) | 518 | if (p_slot->state == BLINKINGOFF_STATE) |
519 | p_slot->hpc_ops->green_led_on(p_slot); | 519 | p_slot->hpc_ops->green_led_on(p_slot); |
@@ -551,7 +551,7 @@ static void interrupt_event_handler(struct work_struct *work) | |||
551 | handle_button_press_event(p_slot); | 551 | handle_button_press_event(p_slot); |
552 | break; | 552 | break; |
553 | case INT_POWER_FAULT: | 553 | case INT_POWER_FAULT: |
554 | dbg("%s: power fault\n", __FUNCTION__); | 554 | dbg("%s: power fault\n", __func__); |
555 | p_slot->hpc_ops->set_attention_status(p_slot, 1); | 555 | p_slot->hpc_ops->set_attention_status(p_slot, 1); |
556 | p_slot->hpc_ops->green_led_off(p_slot); | 556 | p_slot->hpc_ops->green_led_off(p_slot); |
557 | break; | 557 | break; |
@@ -593,7 +593,7 @@ static int shpchp_enable_slot (struct slot *p_slot) | |||
593 | /* We have to save the presence info for these slots */ | 593 | /* We have to save the presence info for these slots */ |
594 | p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); | 594 | p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); |
595 | p_slot->hpc_ops->get_power_status(p_slot, &(p_slot->pwr_save)); | 595 | p_slot->hpc_ops->get_power_status(p_slot, &(p_slot->pwr_save)); |
596 | dbg("%s: p_slot->pwr_save %x\n", __FUNCTION__, p_slot->pwr_save); | 596 | dbg("%s: p_slot->pwr_save %x\n", __func__, p_slot->pwr_save); |
597 | p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); | 597 | p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); |
598 | 598 | ||
599 | if(((p_slot->ctrl->pci_dev->vendor == PCI_VENDOR_ID_AMD) || | 599 | if(((p_slot->ctrl->pci_dev->vendor == PCI_VENDOR_ID_AMD) || |