aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/pciehp_hpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug/pciehp_hpc.c')
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 13b2eaf7ba43..5127f3f41821 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -773,23 +773,32 @@ static void pcie_shutdown_notification(struct controller *ctrl)
773static int pcie_init_slot(struct controller *ctrl) 773static int pcie_init_slot(struct controller *ctrl)
774{ 774{
775 struct slot *slot; 775 struct slot *slot;
776 char name[32];
776 777
777 slot = kzalloc(sizeof(*slot), GFP_KERNEL); 778 slot = kzalloc(sizeof(*slot), GFP_KERNEL);
778 if (!slot) 779 if (!slot)
779 return -ENOMEM; 780 return -ENOMEM;
780 781
782 snprintf(name, sizeof(name), "pciehp-%u", PSN(ctrl));
783 slot->wq = alloc_workqueue(name, 0, 0);
784 if (!slot->wq)
785 goto abort;
786
781 slot->ctrl = ctrl; 787 slot->ctrl = ctrl;
782 mutex_init(&slot->lock); 788 mutex_init(&slot->lock);
783 INIT_DELAYED_WORK(&slot->work, pciehp_queue_pushbutton_work); 789 INIT_DELAYED_WORK(&slot->work, pciehp_queue_pushbutton_work);
784 ctrl->slot = slot; 790 ctrl->slot = slot;
785 return 0; 791 return 0;
792abort:
793 kfree(slot);
794 return -ENOMEM;
786} 795}
787 796
788static void pcie_cleanup_slot(struct controller *ctrl) 797static void pcie_cleanup_slot(struct controller *ctrl)
789{ 798{
790 struct slot *slot = ctrl->slot; 799 struct slot *slot = ctrl->slot;
791 cancel_delayed_work(&slot->work); 800 cancel_delayed_work(&slot->work);
792 flush_workqueue(pciehp_wq); 801 destroy_workqueue(slot->wq);
793 kfree(slot); 802 kfree(slot);
794} 803}
795 804