]> err.no Git - linux-2.6/blobdiff - drivers/pci/hotplug/shpchp_core.c
Pull bugfix into test branch
[linux-2.6] / drivers / pci / hotplug / shpchp_core.c
index 3be4d492ccc2cf0143125fb154b94a7d4d2e05d0..4eac85b3d90e0a91f449101cf6aed4f1338238be 100644 (file)
@@ -159,7 +159,7 @@ static int init_slots(struct controller *ctrl)
                        goto error_info;
 
                slot->number = sun;
-               INIT_WORK(&slot->work, queue_pushbutton_work, slot);
+               INIT_DELAYED_WORK(&slot->work, queue_pushbutton_work);
 
                /* register this slot with the hotplug pci core */
                hotplug_slot->private = slot;
@@ -449,10 +449,14 @@ static int shpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                ctrl->speed = PCI_SPEED_33MHz;
        }
 
-       shpchp_create_ctrl_files(ctrl);
+       rc = shpchp_create_ctrl_files(ctrl);
+       if (rc)
+               goto err_cleanup_slots;
 
        return 0;
 
+err_cleanup_slots:
+       cleanup_slots(ctrl);
 err_out_release_ctlr:
        ctrl->hpc_ops->release_ctlr(ctrl);
 err_out_free_ctrl:
@@ -491,16 +495,9 @@ static int __init shpcd_init(void)
        shpchp_poll_mode = 1;
 #endif
 
-       shpchp_wq = create_singlethread_workqueue("shpchpd");
-       if (!shpchp_wq)
-               return -ENOMEM;
-
        retval = pci_register_driver(&shpc_driver);
        dbg("%s: pci_register_driver = %d\n", __FUNCTION__, retval);
        info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
-       if (retval) {
-               destroy_workqueue(shpchp_wq);
-       }
        return retval;
 }
 
@@ -508,7 +505,6 @@ static void __exit shpcd_cleanup(void)
 {
        dbg("unload_shpchpd()\n");
        pci_unregister_driver(&shpc_driver);
-       destroy_workqueue(shpchp_wq);
        info(DRIVER_DESC " version: " DRIVER_VERSION " unloaded\n");
 }