[PATCH 4/9] pci/msi: introduce attach_msi_entry()

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

 



attach_msi_entry() is a kin of alloc_msi_entry() and free_msi_entries().
It is a bit more intuitive than plain list_add_tail().

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

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index b710a82..cd80360 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -280,6 +280,11 @@ static void free_msi_entries(struct pci_dev *dev)
 	}
 }
 
+static void attach_msi_entry(struct pci_dev *dev, struct msi_desc *entry)
+{
+	list_add_tail(&entry->list, &dev->msi_list);
+}
+
 static struct msi_desc* alloc_msi_entry(void)
 {
 	struct msi_desc *entry;
@@ -411,7 +416,7 @@ static int msi_capability_init(struct pci_dev *dev)
 			maskbits);
 		entry->msi_attrib.maskbits_mask = temp;
 	}
-	list_add_tail(&entry->list, &dev->msi_list);
+	attach_msi_entry(dev, entry);
 
 	/* Configure MSI capability structure */
 	ret = arch_setup_msi_irqs(dev, 1, PCI_CAP_ID_MSI);
@@ -482,7 +487,7 @@ static int msix_capability_init(struct pci_dev *dev,
 		entry->dev = dev;
 		entry->mask_base = base;
 
-		list_add_tail(&entry->list, &dev->msi_list);
+		attach_msi_entry(dev, entry);
 	}
 
 	ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX);
-- 

--
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