Skip to contentSkip to conversation

nvme-pci: don't open-code nvme_reset_ctrl

PATCH Superseded Sagi Grimberg 2 participants 2 messages Dec 25, 2017 – Dec 29, 2017 NVMe

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Sagi Grimberg

author maintainer
#0 lore raw

PATCH 1/1 nvme-pci: don't open-code nvme_reset_ctrl

Signed-off-by Sagi Grimberg <sagi at grimberg.me>
---
 drivers/nvme/host/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/pci.c +2 -2
index 48c5fb864a61..77200fb89a64 100644
@@ -2487,10 +2487,10 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (result)
 		goto release_pools;
 
-	nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_RESETTING);
 	dev_info(dev->ctrl.device, "pci function %s\n", dev_name(&pdev->dev));
 
-	queue_work(nvme_wq, &dev->ctrl.reset_work);
+	WARN_ON_ONCE(nvme_reset_ctrl(&dev->ctrl));
+
 	return 0;
 
  release_pools:
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 nvme-pci: don't open-code nvme_reset_ctrl

This looks ok, but I really having real functionality inside a WARN_ON statement as that obsufcate? things. But I don't think we even really need the WARN_ON here at all.