]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
scsi: csiostor: Replace PCI pool old API
authorRomain Perier <romain.perier@collabora.com>
Thu, 6 Jul 2017 08:13:04 +0000 (10:13 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 7 Aug 2017 18:04:01 +0000 (14:04 -0400)
The PCI pool API is deprecated. This commit replaces the PCI pool old
API by the appropriate function with the DMA pool API. It also updates
the name of some variables and the content of comments, accordingly.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Reviewed-by: Peter Senna Tschudin <peter.senna@collabora.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/csiostor/csio_hw.h
drivers/scsi/csiostor/csio_init.c
drivers/scsi/csiostor/csio_scsi.c

index 9acb89538e29f28b9173dcb532cae18c8a54042d..667046419b19d3e87b09f31d0dfde6847b7d50a2 100644 (file)
@@ -465,7 +465,7 @@ struct csio_hw {
        struct csio_pport       pport[CSIO_MAX_PPORTS]; /* Ports (XGMACs) */
        struct csio_hw_params   params;                 /* Hw parameters */
 
-       struct pci_pool         *scsi_pci_pool;         /* PCI pool for SCSI */
+       struct dma_pool         *scsi_dma_pool;         /* DMA pool for SCSI */
        mempool_t               *mb_mempool;            /* Mailbox memory pool*/
        mempool_t               *rnode_mempool;         /* rnode memory pool */
 
index ea0c31086cc6b8b44517c8fcd34a44fb6c93fad9..d5fb016b5fc21a1efcc432408cba41ccb8546b5b 100644 (file)
@@ -485,9 +485,10 @@ csio_resource_alloc(struct csio_hw *hw)
        if (!hw->rnode_mempool)
                goto err_free_mb_mempool;
 
-       hw->scsi_pci_pool = pci_pool_create("csio_scsi_pci_pool", hw->pdev,
-                                           CSIO_SCSI_RSP_LEN, 8, 0);
-       if (!hw->scsi_pci_pool)
+       hw->scsi_dma_pool = dma_pool_create("csio_scsi_dma_pool",
+                                           &hw->pdev->dev, CSIO_SCSI_RSP_LEN,
+                                           8, 0);
+       if (!hw->scsi_dma_pool)
                goto err_free_rn_pool;
 
        return 0;
@@ -505,8 +506,8 @@ err:
 static void
 csio_resource_free(struct csio_hw *hw)
 {
-       pci_pool_destroy(hw->scsi_pci_pool);
-       hw->scsi_pci_pool = NULL;
+       dma_pool_destroy(hw->scsi_dma_pool);
+       hw->scsi_dma_pool = NULL;
        mempool_destroy(hw->rnode_mempool);
        hw->rnode_mempool = NULL;
        mempool_destroy(hw->mb_mempool);
index a1ff75f1384f4e96e3c6e8456a78513659533135..dab0d3f9bee139934eba2d551ece7db13d8486fa 100644 (file)
@@ -2445,7 +2445,7 @@ csio_scsim_init(struct csio_scsim *scm, struct csio_hw *hw)
 
                /* Allocate Dma buffers for Response Payload */
                dma_buf = &ioreq->dma_buf;
-               dma_buf->vaddr = pci_pool_alloc(hw->scsi_pci_pool, GFP_KERNEL,
+               dma_buf->vaddr = dma_pool_alloc(hw->scsi_dma_pool, GFP_KERNEL,
                                                &dma_buf->paddr);
                if (!dma_buf->vaddr) {
                        csio_err(hw,
@@ -2485,7 +2485,7 @@ free_ioreq:
                ioreq = (struct csio_ioreq *)tmp;
 
                dma_buf = &ioreq->dma_buf;
-               pci_pool_free(hw->scsi_pci_pool, dma_buf->vaddr,
+               dma_pool_free(hw->scsi_dma_pool, dma_buf->vaddr,
                              dma_buf->paddr);
 
                kfree(ioreq);
@@ -2516,7 +2516,7 @@ csio_scsim_exit(struct csio_scsim *scm)
                ioreq = (struct csio_ioreq *)tmp;
 
                dma_buf = &ioreq->dma_buf;
-               pci_pool_free(scm->hw->scsi_pci_pool, dma_buf->vaddr,
+               dma_pool_free(scm->hw->scsi_dma_pool, dma_buf->vaddr,
                              dma_buf->paddr);
 
                kfree(ioreq);