Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7494440 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Roland Dreier
Browse files

RDMA/amso1100: Use the dma state API instead of pci equivalents



The DMA API is preferred; no functional change.

Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 0eddb519
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -250,7 +250,7 @@ struct c2_array {
struct sp_chunk {
	struct sp_chunk *next;
	dma_addr_t dma_addr;
	DECLARE_PCI_UNMAP_ADDR(mapping);
	DEFINE_DMA_UNMAP_ADDR(mapping);
	u16 head;
	u16 shared_ptr[0];
};
+2 −2
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ static int c2_alloc_mqsp_chunk(struct c2_dev *c2dev, gfp_t gfp_mask,
		return -ENOMEM;

	new_head->dma_addr = dma_addr;
	pci_unmap_addr_set(new_head, mapping, new_head->dma_addr);
	dma_unmap_addr_set(new_head, mapping, new_head->dma_addr);

	new_head->next = NULL;
	new_head->head = 0;
@@ -81,7 +81,7 @@ void c2_free_mqsp_pool(struct c2_dev *c2dev, struct sp_chunk *root)
	while (root) {
		next = root->next;
		dma_free_coherent(&c2dev->pcidev->dev, PAGE_SIZE, root,
				  pci_unmap_addr(root, mapping));
				  dma_unmap_addr(root, mapping));
		root = next;
	}
}
+2 −2
Original line number Diff line number Diff line
@@ -257,7 +257,7 @@ int c2_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags notify_flags)
static void c2_free_cq_buf(struct c2_dev *c2dev, struct c2_mq *mq)
{
	dma_free_coherent(&c2dev->pcidev->dev, mq->q_size * mq->msg_size,
			  mq->msg_pool.host, pci_unmap_addr(mq, mapping));
			  mq->msg_pool.host, dma_unmap_addr(mq, mapping));
}

static int c2_alloc_cq_buf(struct c2_dev *c2dev, struct c2_mq *mq, int q_size,
@@ -278,7 +278,7 @@ static int c2_alloc_cq_buf(struct c2_dev *c2dev, struct c2_mq *mq, int q_size,
		       NULL,	/* peer (currently unknown) */
		       C2_MQ_HOST_TARGET);

	pci_unmap_addr_set(mq, mapping, mq->host_dma);
	dma_unmap_addr_set(mq, mapping, mq->host_dma);

	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ struct c2_mq {
		u8 __iomem *adapter;
	} msg_pool;
	dma_addr_t host_dma;
	DECLARE_PCI_UNMAP_ADDR(mapping);
	DEFINE_DMA_UNMAP_ADDR(mapping);
	u16 hint_count;
	u16 priv;
	struct c2_mq_shared __iomem *peer;
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@

struct c2_buf_list {
	void *buf;
	 DECLARE_PCI_UNMAP_ADDR(mapping)
	DEFINE_DMA_UNMAP_ADDR(mapping);
};


Loading