dev_warn(&dev->pci_dev->dev,
"I/O %d QID %d timeout, reset controller\n", cmdid,
nvmeq->qid);
- INIT_WORK(&dev->reset_work, nvme_reset_failed_dev);
+ PREPARE_WORK(&dev->reset_work, nvme_reset_failed_dev);
queue_work(nvme_workq, &dev->reset_work);
return;
}
list_del_init(&dev->node);
dev_warn(&dev->pci_dev->dev,
"Failed status, reset controller\n");
- INIT_WORK(&dev->reset_work,
+ PREPARE_WORK(&dev->reset_work,
nvme_reset_failed_dev);
queue_work(nvme_workq, &dev->reset_work);
continue;
return ret;
if (ret == -EBUSY) {
spin_lock(&dev_list_lock);
- INIT_WORK(&dev->reset_work, nvme_remove_disks);
+ PREPARE_WORK(&dev->reset_work, nvme_remove_disks);
queue_work(nvme_workq, &dev->reset_work);
spin_unlock(&dev_list_lock);
}
goto free;
INIT_LIST_HEAD(&dev->namespaces);
+ INIT_WORK(&dev->reset_work, nvme_reset_failed_dev);
dev->pci_dev = pdev;
pci_set_drvdata(pdev, dev);
result = nvme_set_instance(dev);
struct nvme_dev *ndev = pci_get_drvdata(pdev);
if (nvme_dev_resume(ndev) && !work_busy(&ndev->reset_work)) {
- INIT_WORK(&ndev->reset_work, nvme_reset_failed_dev);
+ PREPARE_WORK(&ndev->reset_work, nvme_reset_failed_dev);
queue_work(nvme_workq, &ndev->reset_work);
}
return 0;