Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: shpchp: Remove hpc_ops

Remove the hpc_ops struct from shpchp. This struct is unnecessary and no
other hotplug controller implements it. A similar thing has already been
done in pciehp with 82a9e79ef132 ("PCI: pciehp: remove hpc_ops").

Link: https://lore.kernel.org/r/Zp-XXVW4hlcMASEc@archbtw
Signed-off-by: ngn <ngn@ngn.tf>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

authored by

ngn and committed by
Bjorn Helgaas
5d8491ae 8400291e

+82 -118
-5
drivers/pci/hotplug/TODO
··· 51 51 52 52 shpchp: 53 53 54 - * There is only a single implementation of struct hpc_ops. Can the struct be 55 - removed and its functions invoked directly? This has already been done in 56 - pciehp with commit 82a9e79ef132 ("PCI: pciehp: remove hpc_ops"). Clarify 57 - if there was a specific reason not to apply the same change to shpchp. 58 - 59 54 * The hardirq handler shpc_isr() queues events on a workqueue. It can be 60 55 simplified by converting it to threaded IRQ handling. Use pciehp as a 61 56 template.
+17 -21
drivers/pci/hotplug/shpchp.h
··· 72 72 u8 latch_save; 73 73 u8 pwr_save; 74 74 struct controller *ctrl; 75 - const struct hpc_ops *hpc_ops; 76 75 struct hotplug_slot hotplug_slot; 77 76 struct list_head slot_list; 78 77 struct delayed_work work; /* work for button event */ ··· 93 94 int slot_num_inc; /* 1 or -1 */ 94 95 struct pci_dev *pci_dev; 95 96 struct list_head slot_list; 96 - const struct hpc_ops *hpc_ops; 97 97 wait_queue_head_t queue; /* sleep & wake process */ 98 98 u8 slot_device_offset; 99 99 u32 pcix_misc2_reg; /* for amd pogo errata */ ··· 298 300 pci_write_config_dword(p_slot->ctrl->pci_dev, PCIX_MISCII_OFFSET, pcix_misc2_temp); 299 301 } 300 302 301 - struct hpc_ops { 302 - int (*power_on_slot)(struct slot *slot); 303 - int (*slot_enable)(struct slot *slot); 304 - int (*slot_disable)(struct slot *slot); 305 - int (*set_bus_speed_mode)(struct slot *slot, enum pci_bus_speed speed); 306 - int (*get_power_status)(struct slot *slot, u8 *status); 307 - int (*get_attention_status)(struct slot *slot, u8 *status); 308 - int (*set_attention_status)(struct slot *slot, u8 status); 309 - int (*get_latch_status)(struct slot *slot, u8 *status); 310 - int (*get_adapter_status)(struct slot *slot, u8 *status); 311 - int (*get_adapter_speed)(struct slot *slot, enum pci_bus_speed *speed); 312 - int (*get_prog_int)(struct slot *slot, u8 *prog_int); 313 - int (*query_power_fault)(struct slot *slot); 314 - void (*green_led_on)(struct slot *slot); 315 - void (*green_led_off)(struct slot *slot); 316 - void (*green_led_blink)(struct slot *slot); 317 - void (*release_ctlr)(struct controller *ctrl); 318 - int (*check_cmd_status)(struct controller *ctrl); 319 - }; 303 + int shpchp_power_on_slot(struct slot *slot); 304 + int shpchp_slot_enable(struct slot *slot); 305 + int shpchp_slot_disable(struct slot *slot); 306 + int shpchp_set_bus_speed_mode(struct slot *slot, enum pci_bus_speed speed); 307 + int shpchp_get_power_status(struct slot *slot, u8 *status); 308 + int shpchp_get_attention_status(struct slot *slot, u8 *status); 309 + int shpchp_set_attention_status(struct slot *slot, u8 status); 310 + int shpchp_get_latch_status(struct slot *slot, u8 *status); 311 + int shpchp_get_adapter_status(struct slot *slot, u8 *status); 312 + int shpchp_get_adapter_speed(struct slot *slot, enum pci_bus_speed *speed); 313 + int shpchp_get_prog_int(struct slot *slot, u8 *prog_int); 314 + int shpchp_query_power_fault(struct slot *slot); 315 + void shpchp_green_led_on(struct slot *slot); 316 + void shpchp_green_led_off(struct slot *slot); 317 + void shpchp_green_led_blink(struct slot *slot); 318 + void shpchp_release_ctlr(struct controller *ctrl); 319 + int shpchp_check_cmd_status(struct controller *ctrl); 320 320 321 321 #endif /* _SHPCHP_H */
+7 -8
drivers/pci/hotplug/shpchp_core.c
··· 81 81 slot->ctrl = ctrl; 82 82 slot->bus = ctrl->pci_dev->subordinate->number; 83 83 slot->device = ctrl->slot_device_offset + i; 84 - slot->hpc_ops = ctrl->hpc_ops; 85 84 slot->number = ctrl->first_slot + (ctrl->slot_num_inc * i); 86 85 87 86 slot->wq = alloc_workqueue("shpchp-%d", 0, 0, slot->number); ··· 149 150 __func__, slot_name(slot)); 150 151 151 152 slot->attention_save = status; 152 - slot->hpc_ops->set_attention_status(slot, status); 153 + shpchp_set_attention_status(slot, status); 153 154 154 155 return 0; 155 156 } ··· 182 183 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", 183 184 __func__, slot_name(slot)); 184 185 185 - retval = slot->hpc_ops->get_power_status(slot, value); 186 + retval = shpchp_get_power_status(slot, value); 186 187 if (retval < 0) 187 188 *value = slot->pwr_save; 188 189 ··· 197 198 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", 198 199 __func__, slot_name(slot)); 199 200 200 - retval = slot->hpc_ops->get_attention_status(slot, value); 201 + retval = shpchp_get_attention_status(slot, value); 201 202 if (retval < 0) 202 203 *value = slot->attention_save; 203 204 ··· 212 213 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", 213 214 __func__, slot_name(slot)); 214 215 215 - retval = slot->hpc_ops->get_latch_status(slot, value); 216 + retval = shpchp_get_latch_status(slot, value); 216 217 if (retval < 0) 217 218 *value = slot->latch_save; 218 219 ··· 227 228 ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", 228 229 __func__, slot_name(slot)); 229 230 230 - retval = slot->hpc_ops->get_adapter_status(slot, value); 231 + retval = shpchp_get_adapter_status(slot, value); 231 232 if (retval < 0) 232 233 *value = slot->presence_save; 233 234 ··· 292 293 err_cleanup_slots: 293 294 cleanup_slots(ctrl); 294 295 err_out_release_ctlr: 295 - ctrl->hpc_ops->release_ctlr(ctrl); 296 + shpchp_release_ctlr(ctrl); 296 297 err_out_free_ctrl: 297 298 kfree(ctrl); 298 299 err_out_none: ··· 305 306 306 307 dev->shpc_managed = 0; 307 308 shpchp_remove_ctrl_files(ctrl); 308 - ctrl->hpc_ops->release_ctlr(ctrl); 309 + shpchp_release_ctlr(ctrl); 309 310 kfree(ctrl); 310 311 } 311 312
+39 -40
drivers/pci/hotplug/shpchp_ctrl.c
··· 51 51 ctrl_dbg(ctrl, "Attention button interrupt received\n"); 52 52 53 53 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); 54 - p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); 54 + shpchp_get_adapter_status(p_slot, &p_slot->presence_save); 55 55 56 56 /* 57 57 * Button pressed - See if need to TAKE ACTION!!! ··· 75 75 ctrl_dbg(ctrl, "Switch interrupt received\n"); 76 76 77 77 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); 78 - p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); 79 - p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 78 + shpchp_get_adapter_status(p_slot, &p_slot->presence_save); 79 + shpchp_get_latch_status(p_slot, &getstatus); 80 80 ctrl_dbg(ctrl, "Card present %x Power status %x\n", 81 81 p_slot->presence_save, p_slot->pwr_save); 82 82 ··· 116 116 /* 117 117 * Save the presence state 118 118 */ 119 - p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); 119 + shpchp_get_adapter_status(p_slot, &p_slot->presence_save); 120 120 if (p_slot->presence_save) { 121 121 /* 122 122 * Card Present ··· 148 148 149 149 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); 150 150 151 - if (!(p_slot->hpc_ops->query_power_fault(p_slot))) { 151 + if (!(shpchp_query_power_fault(p_slot))) { 152 152 /* 153 153 * Power fault Cleared 154 154 */ ··· 181 181 int rc = 0; 182 182 183 183 ctrl_dbg(ctrl, "Change speed to %d\n", speed); 184 - rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, speed); 184 + rc = shpchp_set_bus_speed_mode(p_slot, speed); 185 185 if (rc) { 186 186 ctrl_err(ctrl, "%s: Issue of set bus speed mode command failed\n", 187 187 __func__); ··· 241 241 __func__, p_slot->device, ctrl->slot_device_offset, hp_slot); 242 242 243 243 /* Power on slot without connecting to bus */ 244 - rc = p_slot->hpc_ops->power_on_slot(p_slot); 244 + rc = shpchp_power_on_slot(p_slot); 245 245 if (rc) { 246 246 ctrl_err(ctrl, "Failed to power on slot\n"); 247 247 return -1; 248 248 } 249 249 250 250 if ((ctrl->pci_dev->vendor == 0x8086) && (ctrl->pci_dev->device == 0x0332)) { 251 - rc = p_slot->hpc_ops->set_bus_speed_mode(p_slot, PCI_SPEED_33MHz); 251 + rc = shpchp_set_bus_speed_mode(p_slot, PCI_SPEED_33MHz); 252 252 if (rc) { 253 253 ctrl_err(ctrl, "%s: Issue of set bus speed mode command failed\n", 254 254 __func__); ··· 256 256 } 257 257 258 258 /* turn on board, blink green LED, turn off Amber LED */ 259 - rc = p_slot->hpc_ops->slot_enable(p_slot); 259 + rc = shpchp_slot_enable(p_slot); 260 260 if (rc) { 261 261 ctrl_err(ctrl, "Issue of Slot Enable command failed\n"); 262 262 return rc; 263 263 } 264 264 } 265 265 266 - rc = p_slot->hpc_ops->get_adapter_speed(p_slot, &asp); 266 + rc = shpchp_get_adapter_speed(p_slot, &asp); 267 267 if (rc) { 268 268 ctrl_err(ctrl, "Can't get adapter speed or bus mode mismatch\n"); 269 269 return WRONG_BUS_FREQUENCY; ··· 285 285 return rc; 286 286 287 287 /* turn on board, blink green LED, turn off Amber LED */ 288 - rc = p_slot->hpc_ops->slot_enable(p_slot); 288 + rc = shpchp_slot_enable(p_slot); 289 289 if (rc) { 290 290 ctrl_err(ctrl, "Issue of Slot Enable command failed\n"); 291 291 return rc; ··· 313 313 p_slot->is_a_board = 0x01; 314 314 p_slot->pwr_save = 1; 315 315 316 - p_slot->hpc_ops->green_led_on(p_slot); 316 + shpchp_green_led_on(p_slot); 317 317 318 318 return 0; 319 319 320 320 err_exit: 321 321 /* turn off slot, turn on Amber LED, turn off Green LED */ 322 - rc = p_slot->hpc_ops->slot_disable(p_slot); 322 + rc = shpchp_slot_disable(p_slot); 323 323 if (rc) { 324 324 ctrl_err(ctrl, "%s: Issue of Slot Disable command failed\n", 325 325 __func__); ··· 352 352 p_slot->status = 0x01; 353 353 354 354 /* turn off slot, turn on Amber LED, turn off Green LED */ 355 - rc = p_slot->hpc_ops->slot_disable(p_slot); 355 + rc = shpchp_slot_disable(p_slot); 356 356 if (rc) { 357 357 ctrl_err(ctrl, "%s: Issue of Slot Disable command failed\n", 358 358 __func__); 359 359 return rc; 360 360 } 361 361 362 - rc = p_slot->hpc_ops->set_attention_status(p_slot, 0); 362 + rc = shpchp_set_attention_status(p_slot, 0); 363 363 if (rc) { 364 364 ctrl_err(ctrl, "Issue of Set Attention command failed\n"); 365 365 return rc; ··· 401 401 case POWERON_STATE: 402 402 mutex_unlock(&p_slot->lock); 403 403 if (shpchp_enable_slot(p_slot)) 404 - p_slot->hpc_ops->green_led_off(p_slot); 404 + shpchp_green_led_off(p_slot); 405 405 mutex_lock(&p_slot->lock); 406 406 p_slot->state = STATIC_STATE; 407 407 break; ··· 446 446 447 447 static void update_slot_info(struct slot *slot) 448 448 { 449 - slot->hpc_ops->get_power_status(slot, &slot->pwr_save); 450 - slot->hpc_ops->get_attention_status(slot, &slot->attention_save); 451 - slot->hpc_ops->get_latch_status(slot, &slot->latch_save); 452 - slot->hpc_ops->get_adapter_status(slot, &slot->presence_save); 449 + shpchp_get_power_status(slot, &slot->pwr_save); 450 + shpchp_get_attention_status(slot, &slot->attention_save); 451 + shpchp_get_latch_status(slot, &slot->latch_save); 452 + shpchp_get_adapter_status(slot, &slot->presence_save); 453 453 } 454 454 455 455 /* ··· 462 462 463 463 switch (p_slot->state) { 464 464 case STATIC_STATE: 465 - p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 465 + shpchp_get_power_status(p_slot, &getstatus); 466 466 if (getstatus) { 467 467 p_slot->state = BLINKINGOFF_STATE; 468 468 ctrl_info(ctrl, "PCI slot #%s - powering off due to button press\n", ··· 473 473 slot_name(p_slot)); 474 474 } 475 475 /* blink green LED and turn off amber */ 476 - p_slot->hpc_ops->green_led_blink(p_slot); 477 - p_slot->hpc_ops->set_attention_status(p_slot, 0); 476 + shpchp_green_led_blink(p_slot); 477 + shpchp_set_attention_status(p_slot, 0); 478 478 479 479 queue_delayed_work(p_slot->wq, &p_slot->work, 5*HZ); 480 480 break; ··· 489 489 slot_name(p_slot)); 490 490 cancel_delayed_work(&p_slot->work); 491 491 if (p_slot->state == BLINKINGOFF_STATE) 492 - p_slot->hpc_ops->green_led_on(p_slot); 492 + shpchp_green_led_on(p_slot); 493 493 else 494 - p_slot->hpc_ops->green_led_off(p_slot); 495 - p_slot->hpc_ops->set_attention_status(p_slot, 0); 494 + shpchp_green_led_off(p_slot); 495 + shpchp_set_attention_status(p_slot, 0); 496 496 ctrl_info(ctrl, "PCI slot #%s - action canceled due to button press\n", 497 497 slot_name(p_slot)); 498 498 p_slot->state = STATIC_STATE; ··· 526 526 break; 527 527 case INT_POWER_FAULT: 528 528 ctrl_dbg(p_slot->ctrl, "%s: Power fault\n", __func__); 529 - p_slot->hpc_ops->set_attention_status(p_slot, 1); 530 - p_slot->hpc_ops->green_led_off(p_slot); 529 + shpchp_set_attention_status(p_slot, 1); 530 + shpchp_green_led_off(p_slot); 531 531 break; 532 532 default: 533 533 update_slot_info(p_slot); ··· 547 547 548 548 /* Check to see if (latch closed, card present, power off) */ 549 549 mutex_lock(&p_slot->ctrl->crit_sect); 550 - rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 550 + rc = shpchp_get_adapter_status(p_slot, &getstatus); 551 551 if (rc || !getstatus) { 552 552 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); 553 553 goto out; 554 554 } 555 - rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 555 + rc = shpchp_get_latch_status(p_slot, &getstatus); 556 556 if (rc || getstatus) { 557 557 ctrl_info(ctrl, "Latch open on slot(%s)\n", slot_name(p_slot)); 558 558 goto out; 559 559 } 560 - rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 560 + rc = shpchp_get_power_status(p_slot, &getstatus); 561 561 if (rc || getstatus) { 562 562 ctrl_info(ctrl, "Already enabled on slot(%s)\n", 563 563 slot_name(p_slot)); ··· 567 567 p_slot->is_a_board = 1; 568 568 569 569 /* We have to save the presence info for these slots */ 570 - p_slot->hpc_ops->get_adapter_status(p_slot, &(p_slot->presence_save)); 571 - p_slot->hpc_ops->get_power_status(p_slot, &(p_slot->pwr_save)); 570 + shpchp_get_adapter_status(p_slot, &p_slot->presence_save); 571 + shpchp_get_power_status(p_slot, &p_slot->pwr_save); 572 572 ctrl_dbg(ctrl, "%s: p_slot->pwr_save %x\n", __func__, p_slot->pwr_save); 573 - p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 573 + shpchp_get_latch_status(p_slot, &getstatus); 574 574 575 575 if ((p_slot->ctrl->pci_dev->vendor == PCI_VENDOR_ID_AMD && 576 576 p_slot->ctrl->pci_dev->device == PCI_DEVICE_ID_AMD_POGO_7458) ··· 584 584 retval = board_added(p_slot); 585 585 586 586 if (retval) { 587 - p_slot->hpc_ops->get_adapter_status(p_slot, 588 - &(p_slot->presence_save)); 589 - p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 587 + shpchp_get_adapter_status(p_slot, &p_slot->presence_save); 588 + shpchp_get_latch_status(p_slot, &getstatus); 590 589 } 591 590 592 591 update_slot_info(p_slot); ··· 607 608 /* Check to see if (latch closed, card present, power on) */ 608 609 mutex_lock(&p_slot->ctrl->crit_sect); 609 610 610 - rc = p_slot->hpc_ops->get_adapter_status(p_slot, &getstatus); 611 + rc = shpchp_get_adapter_status(p_slot, &getstatus); 611 612 if (rc || !getstatus) { 612 613 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); 613 614 goto out; 614 615 } 615 - rc = p_slot->hpc_ops->get_latch_status(p_slot, &getstatus); 616 + rc = shpchp_get_latch_status(p_slot, &getstatus); 616 617 if (rc || getstatus) { 617 618 ctrl_info(ctrl, "Latch open on slot(%s)\n", slot_name(p_slot)); 618 619 goto out; 619 620 } 620 - rc = p_slot->hpc_ops->get_power_status(p_slot, &getstatus); 621 + rc = shpchp_get_power_status(p_slot, &getstatus); 621 622 if (rc || !getstatus) { 622 623 ctrl_info(ctrl, "Already disabled on slot(%s)\n", 623 624 slot_name(p_slot));
+19 -44
drivers/pci/hotplug/shpchp_hpc.c
··· 167 167 168 168 static irqreturn_t shpc_isr(int irq, void *dev_id); 169 169 static void start_int_poll_timer(struct controller *ctrl, int sec); 170 - static int hpc_check_cmd_status(struct controller *ctrl); 171 170 172 171 static inline u8 shpc_readb(struct controller *ctrl, int reg) 173 172 { ··· 316 317 if (retval) 317 318 goto out; 318 319 319 - cmd_status = hpc_check_cmd_status(slot->ctrl); 320 + cmd_status = shpchp_check_cmd_status(slot->ctrl); 320 321 if (cmd_status) { 321 322 ctrl_err(ctrl, "Failed to issued command 0x%x (error code = %d)\n", 322 323 cmd, cmd_status); ··· 327 328 return retval; 328 329 } 329 330 330 - static int hpc_check_cmd_status(struct controller *ctrl) 331 + int shpchp_check_cmd_status(struct controller *ctrl) 331 332 { 332 333 int retval = 0; 333 334 u16 cmd_status = shpc_readw(ctrl, CMD_STATUS) & 0x000F; ··· 356 357 } 357 358 358 359 359 - static int hpc_get_attention_status(struct slot *slot, u8 *status) 360 + int shpchp_get_attention_status(struct slot *slot, u8 *status) 360 361 { 361 362 struct controller *ctrl = slot->ctrl; 362 363 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); ··· 380 381 return 0; 381 382 } 382 383 383 - static int hpc_get_power_status(struct slot *slot, u8 *status) 384 + int shpchp_get_power_status(struct slot *slot, u8 *status) 384 385 { 385 386 struct controller *ctrl = slot->ctrl; 386 387 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); ··· 405 406 } 406 407 407 408 408 - static int hpc_get_latch_status(struct slot *slot, u8 *status) 409 + int shpchp_get_latch_status(struct slot *slot, u8 *status) 409 410 { 410 411 struct controller *ctrl = slot->ctrl; 411 412 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); ··· 415 416 return 0; 416 417 } 417 418 418 - static int hpc_get_adapter_status(struct slot *slot, u8 *status) 419 + int shpchp_get_adapter_status(struct slot *slot, u8 *status) 419 420 { 420 421 struct controller *ctrl = slot->ctrl; 421 422 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); ··· 426 427 return 0; 427 428 } 428 429 429 - static int hpc_get_prog_int(struct slot *slot, u8 *prog_int) 430 + int shpchp_get_prog_int(struct slot *slot, u8 *prog_int) 430 431 { 431 432 struct controller *ctrl = slot->ctrl; 432 433 ··· 435 436 return 0; 436 437 } 437 438 438 - static int hpc_get_adapter_speed(struct slot *slot, enum pci_bus_speed *value) 439 + int shpchp_get_adapter_speed(struct slot *slot, enum pci_bus_speed *value) 439 440 { 440 441 int retval = 0; 441 442 struct controller *ctrl = slot->ctrl; ··· 443 444 u8 m66_cap = !!(slot_reg & MHZ66_CAP); 444 445 u8 pi, pcix_cap; 445 446 446 - retval = hpc_get_prog_int(slot, &pi); 447 + retval = shpchp_get_prog_int(slot, &pi); 447 448 if (retval) 448 449 return retval; 449 450 ··· 488 489 return retval; 489 490 } 490 491 491 - static int hpc_query_power_fault(struct slot *slot) 492 + int shpchp_query_power_fault(struct slot *slot) 492 493 { 493 494 struct controller *ctrl = slot->ctrl; 494 495 u32 slot_reg = shpc_readl(ctrl, SLOT_REG(slot->hp_slot)); ··· 497 498 return !(slot_reg & POWER_FAULT); 498 499 } 499 500 500 - static int hpc_set_attention_status(struct slot *slot, u8 value) 501 + int shpchp_set_attention_status(struct slot *slot, u8 value) 501 502 { 502 503 u8 slot_cmd = 0; 503 504 ··· 519 520 } 520 521 521 522 522 - static void hpc_set_green_led_on(struct slot *slot) 523 + void shpchp_green_led_on(struct slot *slot) 523 524 { 524 525 shpc_write_cmd(slot, slot->hp_slot, SET_PWR_ON); 525 526 } 526 527 527 - static void hpc_set_green_led_off(struct slot *slot) 528 + void shpchp_green_led_off(struct slot *slot) 528 529 { 529 530 shpc_write_cmd(slot, slot->hp_slot, SET_PWR_OFF); 530 531 } 531 532 532 - static void hpc_set_green_led_blink(struct slot *slot) 533 + void shpchp_green_led_blink(struct slot *slot) 533 534 { 534 535 shpc_write_cmd(slot, slot->hp_slot, SET_PWR_BLINK); 535 536 } 536 537 537 - static void hpc_release_ctlr(struct controller *ctrl) 538 + void shpchp_release_ctlr(struct controller *ctrl) 538 539 { 539 540 int i; 540 541 u32 slot_reg, serr_int; ··· 574 575 release_mem_region(ctrl->mmio_base, ctrl->mmio_size); 575 576 } 576 577 577 - static int hpc_power_on_slot(struct slot *slot) 578 + int shpchp_power_on_slot(struct slot *slot) 578 579 { 579 580 int retval; 580 581 ··· 585 586 return retval; 586 587 } 587 588 588 - static int hpc_slot_enable(struct slot *slot) 589 + int shpchp_slot_enable(struct slot *slot) 589 590 { 590 591 int retval; 591 592 ··· 598 599 return retval; 599 600 } 600 601 601 - static int hpc_slot_disable(struct slot *slot) 602 + int shpchp_slot_disable(struct slot *slot) 602 603 { 603 604 int retval; 604 605 ··· 680 681 } 681 682 682 683 683 - static int hpc_set_bus_speed_mode(struct slot *slot, enum pci_bus_speed value) 684 + int shpchp_set_bus_speed_mode(struct slot *slot, enum pci_bus_speed value) 684 685 { 685 686 int retval; 686 687 struct controller *ctrl = slot->ctrl; ··· 870 871 return retval; 871 872 } 872 873 873 - static const struct hpc_ops shpchp_hpc_ops = { 874 - .power_on_slot = hpc_power_on_slot, 875 - .slot_enable = hpc_slot_enable, 876 - .slot_disable = hpc_slot_disable, 877 - .set_bus_speed_mode = hpc_set_bus_speed_mode, 878 - .set_attention_status = hpc_set_attention_status, 879 - .get_power_status = hpc_get_power_status, 880 - .get_attention_status = hpc_get_attention_status, 881 - .get_latch_status = hpc_get_latch_status, 882 - .get_adapter_status = hpc_get_adapter_status, 883 - 884 - .get_adapter_speed = hpc_get_adapter_speed, 885 - .get_prog_int = hpc_get_prog_int, 886 - 887 - .query_power_fault = hpc_query_power_fault, 888 - .green_led_on = hpc_set_green_led_on, 889 - .green_led_off = hpc_set_green_led_off, 890 - .green_led_blink = hpc_set_green_led_blink, 891 - 892 - .release_ctlr = hpc_release_ctlr, 893 - }; 894 - 895 874 int shpc_init(struct controller *ctrl, struct pci_dev *pdev) 896 875 { 897 876 int rc = -1, num_slots = 0; ··· 954 977 955 978 /* Setup wait queue */ 956 979 init_waitqueue_head(&ctrl->queue); 957 - 958 - ctrl->hpc_ops = &shpchp_hpc_ops; 959 980 960 981 /* Return PCI Controller Info */ 961 982 slot_config = shpc_readl(ctrl, SLOT_CONFIG);