aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/i40evf/i40evf_main.c
diff options
context:
space:
mode:
authorJean Sacren <sakiwit@gmail.com>2014-03-25 00:30:27 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-03-31 18:48:02 -0400
commite3e3bfdd1d2ad4ac2020e681f3cb1e172f343810 (patch)
treeb30bc5d138d2aa618828bb67e208335cf1c3e6d4 /drivers/net/ethernet/intel/i40evf/i40evf_main.c
parent21d3efdc2d47fa0e7d34329e55471e26fbf37fd7 (diff)
i40e/i40evf: fix error checking path
The commit 6494294f277fd ("i40e/i40evf: Use dma_set_mask_and_coherent") uses dma_set_mask_and_coherent() to replace dma_set_coherent_mask() for the benefit of return error. The conversion brings some confusion in error checking as whether against DMA_BIT_MASK(64) or DMA_BIT_MASK(32). For one, if error is zero, the check will be against DMA_BIT_MASK(64) twice. Fix this error checking by binding the check to the pertinent one. Cc: Mitch Williams <mitch.a.williams@intel.com> Signed-off-by: Jean Sacren <sakiwit@gmail.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/i40evf/i40evf_main.c')
-rw-r--r--drivers/net/ethernet/intel/i40evf/i40evf_main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 51c84c19d2be..e35e66ffa782 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -2191,12 +2191,13 @@ static int i40evf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2191 return err; 2191 return err;
2192 2192
2193 err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); 2193 err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
2194 if (err)
2195 err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
2196 if (err) { 2194 if (err) {
2197 dev_err(&pdev->dev, 2195 err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
2198 "DMA configuration failed: 0x%x\n", err); 2196 if (err) {
2199 goto err_dma; 2197 dev_err(&pdev->dev,
2198 "DMA configuration failed: 0x%x\n", err);
2199 goto err_dma;
2200 }
2200 } 2201 }
2201 2202
2202 err = pci_request_regions(pdev, i40evf_driver_name); 2203 err = pci_request_regions(pdev, i40evf_driver_name);