[PATCH 5/9] nvme-pci: remove nvme_pci_disable
Eric Curtin
ecurtin at redhat.com
Tue Dec 6 02:39:10 PST 2022
On Tue, 29 Nov 2022 at 13:29, Christoph Hellwig <hch at lst.de> wrote:
>
> nvme_pci_disable has a single caller, fold it into that.
>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
Reviewed-by: Eric Curtin <ecurtin at redhat.com>
> ---
> drivers/nvme/host/pci.c | 18 +++++-------------
> 1 file changed, 5 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
> index c6a02210d22b46..c3d9b23699d3f3 100644
> --- a/drivers/nvme/host/pci.c
> +++ b/drivers/nvme/host/pci.c
> @@ -2657,18 +2657,6 @@ static void nvme_dev_unmap(struct nvme_dev *dev)
> pci_release_mem_regions(to_pci_dev(dev->dev));
> }
>
> -static void nvme_pci_disable(struct nvme_dev *dev)
> -{
> - struct pci_dev *pdev = to_pci_dev(dev->dev);
> -
> - pci_free_irq_vectors(pdev);
> -
> - if (pci_is_enabled(pdev)) {
> - pci_disable_pcie_error_reporting(pdev);
> - pci_disable_device(pdev);
> - }
> -}
> -
> static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
> {
> bool dead = true, freeze = false;
> @@ -2708,7 +2696,11 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
> }
> nvme_suspend_io_queues(dev);
> nvme_suspend_queue(&dev->queues[0]);
> - nvme_pci_disable(dev);
> + pci_free_irq_vectors(pdev);
> + if (pci_is_enabled(pdev)) {
> + pci_disable_pcie_error_reporting(pdev);
> + pci_disable_device(pdev);
> + }
> nvme_reap_pending_cqes(dev);
>
> nvme_cancel_tagset(&dev->ctrl);
> --
> 2.30.2
>
>
More information about the Linux-nvme
mailing list