@@ -7352,26 +7352,19 @@ lpfc_post_init_setup(struct lpfc_hba *phba)
7352
7352
static int
7353
7353
lpfc_sli_pci_mem_setup (struct lpfc_hba * phba )
7354
7354
{
7355
- struct pci_dev * pdev ;
7355
+ struct pci_dev * pdev = phba -> pcidev ;
7356
7356
unsigned long bar0map_len , bar2map_len ;
7357
7357
int i , hbq_count ;
7358
7358
void * ptr ;
7359
7359
int error = - ENODEV ;
7360
7360
7361
- /* Obtain PCI device reference */
7362
- if (!phba -> pcidev )
7361
+ if (!pdev )
7363
7362
return error ;
7364
- else
7365
- pdev = phba -> pcidev ;
7366
7363
7367
7364
/* Set the device DMA mask size */
7368
- if (pci_set_dma_mask (pdev , DMA_BIT_MASK (64 )) != 0
7369
- || pci_set_consistent_dma_mask (pdev ,DMA_BIT_MASK (64 )) != 0 ) {
7370
- if (pci_set_dma_mask (pdev , DMA_BIT_MASK (32 )) != 0
7371
- || pci_set_consistent_dma_mask (pdev ,DMA_BIT_MASK (32 )) != 0 ) {
7372
- return error ;
7373
- }
7374
- }
7365
+ if (dma_set_mask_and_coherent (& pdev -> dev , DMA_BIT_MASK (64 )) ||
7366
+ dma_set_mask_and_coherent (& pdev -> dev , DMA_BIT_MASK (32 )))
7367
+ return error ;
7375
7368
7376
7369
/* Get the bus address of Bar0 and Bar2 and the number of bytes
7377
7370
* required by each mapping.
@@ -9735,25 +9728,18 @@ lpfc_pci_function_reset(struct lpfc_hba *phba)
9735
9728
static int
9736
9729
lpfc_sli4_pci_mem_setup (struct lpfc_hba * phba )
9737
9730
{
9738
- struct pci_dev * pdev ;
9731
+ struct pci_dev * pdev = phba -> pcidev ;
9739
9732
unsigned long bar0map_len , bar1map_len , bar2map_len ;
9740
9733
int error = - ENODEV ;
9741
9734
uint32_t if_type ;
9742
9735
9743
- /* Obtain PCI device reference */
9744
- if (!phba -> pcidev )
9736
+ if (!pdev )
9745
9737
return error ;
9746
- else
9747
- pdev = phba -> pcidev ;
9748
9738
9749
9739
/* Set the device DMA mask size */
9750
- if (pci_set_dma_mask (pdev , DMA_BIT_MASK (64 )) != 0
9751
- || pci_set_consistent_dma_mask (pdev ,DMA_BIT_MASK (64 )) != 0 ) {
9752
- if (pci_set_dma_mask (pdev , DMA_BIT_MASK (32 )) != 0
9753
- || pci_set_consistent_dma_mask (pdev ,DMA_BIT_MASK (32 )) != 0 ) {
9754
- return error ;
9755
- }
9756
- }
9740
+ if (dma_set_mask_and_coherent (& pdev -> dev , DMA_BIT_MASK (64 )) ||
9741
+ dma_set_mask_and_coherent (& pdev -> dev , DMA_BIT_MASK (32 )))
9742
+ return error ;
9757
9743
9758
9744
/*
9759
9745
* The BARs and register set definitions and offset locations are
0 commit comments