[PATCH 3/9] pci/msi: rename to free_msi_entries()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



msi_free_irqs() and msix_free_all_irqs() do not free "irqs", but free
entries of msi_desc which have attached to the device.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@xxxxxxxxxxxxxx>
---
 drivers/pci/msi.c |   24 +++++++-----------------
 1 files changed, 7 insertions(+), 17 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 38e719a..b710a82 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -255,7 +255,7 @@ void unmask_msi_irq(unsigned int irq)
 	msix_flush_writes(irq);
 }
 
-static int msi_free_irqs(struct pci_dev *dev)
+static void free_msi_entries(struct pci_dev *dev)
 {
 	struct msi_desc *entry, *tmp;
 
@@ -278,13 +278,6 @@ static int msi_free_irqs(struct pci_dev *dev)
 		list_del(&entry->list);
 		kfree(entry);
 	}
-
-	return 0;
-}
-
-static void msix_free_all_irqs(struct pci_dev *dev)
-{
-	msi_free_irqs(dev);
 }
 
 static struct msi_desc* alloc_msi_entry(void)
@@ -423,7 +416,7 @@ static int msi_capability_init(struct pci_dev *dev)
 	/* Configure MSI capability structure */
 	ret = arch_setup_msi_irqs(dev, 1, PCI_CAP_ID_MSI);
 	if (ret) {
-		msi_free_irqs(dev);
+		free_msi_entries(dev);
 		return ret;
 	}
 
@@ -501,7 +494,7 @@ static int msix_capability_init(struct pci_dev *dev,
 			}
 		}
 
-		msi_free_irqs(dev);
+		free_msi_entries(dev);
 
 		/* If we had some success report the number of irqs
 		 * we succeeded in setting up.
@@ -641,7 +634,7 @@ void pci_disable_msi(struct pci_dev* dev)
 	if (!entry->dev || entry->msi_attrib.type != PCI_CAP_ID_MSI)
 		return;
 
-	msi_free_irqs(dev);
+	free_msi_entries(dev);
 }
 EXPORT_SYMBOL(pci_disable_msi);
 
@@ -718,7 +711,7 @@ void pci_disable_msix(struct pci_dev* dev)
 
 	pci_msix_shutdown(dev);
 
-	msix_free_all_irqs(dev);
+	free_msi_entries(dev);
 }
 EXPORT_SYMBOL(pci_disable_msix);
 
@@ -736,11 +729,8 @@ void msi_remove_pci_irq_vectors(struct pci_dev* dev)
 	if (!pci_msi_enable || !dev)
  		return;
 
-	if (dev->msi_enabled)
-		msi_free_irqs(dev);
-
-	if (dev->msix_enabled)
-		msix_free_all_irqs(dev);
+	if (dev->msi_enabled || dev->msix_enabled)
+		free_msi_entries(dev);
 }
 
 void pci_no_msi(void)
-- 

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux