aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/shpchp.h4
-rw-r--r--drivers/pci/hotplug/shpchp_core.c26
2 files changed, 7 insertions, 23 deletions
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index dd449512cf68..f10f1ba877af 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -82,7 +82,6 @@ struct event_info {
82}; 82};
83 83
84struct controller { 84struct controller {
85 struct list_head ctrl_list;
86 struct mutex crit_sect; /* critical section mutex */ 85 struct mutex crit_sect; /* critical section mutex */
87 struct mutex cmd_lock; /* command lock */ 86 struct mutex cmd_lock; /* command lock */
88 struct php_ctlr_state_s *hpc_ctlr_handle; /* HPC controller handle */ 87 struct php_ctlr_state_s *hpc_ctlr_handle; /* HPC controller handle */
@@ -203,9 +202,6 @@ extern void shpchp_remove_ctrl_files(struct controller *ctrl);
203extern void cleanup_slots(struct controller *ctrl); 202extern void cleanup_slots(struct controller *ctrl);
204extern void queue_pushbutton_work(void *data); 203extern void queue_pushbutton_work(void *data);
205 204
206/* Global variables */
207extern struct list_head shpchp_ctrl_list;
208
209struct ctrl_reg { 205struct ctrl_reg {
210 volatile u32 base_offset; 206 volatile u32 base_offset;
211 volatile u32 slot_avail1; 207 volatile u32 slot_avail1;
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
index fa60ae47d91d..0e83c5fbc9df 100644
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -39,7 +39,6 @@
39int shpchp_debug; 39int shpchp_debug;
40int shpchp_poll_mode; 40int shpchp_poll_mode;
41int shpchp_poll_time; 41int shpchp_poll_time;
42LIST_HEAD(shpchp_ctrl_list);
43struct workqueue_struct *shpchp_wq; 42struct workqueue_struct *shpchp_wq;
44 43
45#define DRIVER_VERSION "0.4" 44#define DRIVER_VERSION "0.4"
@@ -433,8 +432,6 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
433 ctrl->speed = PCI_SPEED_33MHz; 432 ctrl->speed = PCI_SPEED_33MHz;
434 } 433 }
435 434
436 list_add(&ctrl->ctrl_list, &shpchp_ctrl_list);
437
438 shpchp_create_ctrl_files(ctrl); 435 shpchp_create_ctrl_files(ctrl);
439 436
440 return 0; 437 return 0;
@@ -447,20 +444,13 @@ err_out_none:
447 return -ENODEV; 444 return -ENODEV;
448} 445}
449 446
450static void __exit unload_shpchpd(void) 447static void shpc_remove(struct pci_dev *dev)
451{ 448{
452 struct list_head *tmp; 449 struct controller *ctrl = pci_get_drvdata(dev);
453 struct list_head *next;
454 struct controller *ctrl;
455
456 list_for_each_safe(tmp, next, &shpchp_ctrl_list) {
457 ctrl = list_entry(tmp, struct controller, ctrl_list);
458 shpchp_remove_ctrl_files(ctrl);
459 ctrl->hpc_ops->release_ctlr(ctrl);
460 kfree(ctrl);
461 }
462 450
463 destroy_workqueue(shpchp_wq); 451 shpchp_remove_ctrl_files(ctrl);
452 ctrl->hpc_ops->release_ctlr(ctrl);
453 kfree(ctrl);
464} 454}
465 455
466static struct pci_device_id shpcd_pci_tbl[] = { 456static struct pci_device_id shpcd_pci_tbl[] = {
@@ -473,7 +463,7 @@ static struct pci_driver shpc_driver = {
473 .name = SHPC_MODULE_NAME, 463 .name = SHPC_MODULE_NAME,
474 .id_table = shpcd_pci_tbl, 464 .id_table = shpcd_pci_tbl,
475 .probe = shpc_probe, 465 .probe = shpc_probe,
476 /* remove: shpc_remove_one, */ 466 .remove = shpc_remove,
477}; 467};
478 468
479static int __init shpcd_init(void) 469static int __init shpcd_init(void)
@@ -500,10 +490,8 @@ static int __init shpcd_init(void)
500static void __exit shpcd_cleanup(void) 490static void __exit shpcd_cleanup(void)
501{ 491{
502 dbg("unload_shpchpd()\n"); 492 dbg("unload_shpchpd()\n");
503 unload_shpchpd();
504
505 pci_unregister_driver(&shpc_driver); 493 pci_unregister_driver(&shpc_driver);
506 494 destroy_workqueue(shpchp_wq);
507 info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n"); 495 info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
508} 496}
509 497