| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * QLogic qlcnic NIC Driver |
|---|
| 3 | 4 | * Copyright (c) 2009-2013 QLogic Corporation |
|---|
| 4 | | - * |
|---|
| 5 | | - * See LICENSE.qlcnic for copyright and licensing details. |
|---|
| 6 | 5 | */ |
|---|
| 7 | 6 | |
|---|
| 8 | 7 | #include "qlcnic.h" |
|---|
| .. | .. |
|---|
| 434 | 433 | *(tx_ring->hw_consumer) = 0; |
|---|
| 435 | 434 | |
|---|
| 436 | 435 | rq_size = SIZEOF_HOSTRQ_TX(struct qlcnic_hostrq_tx_ctx); |
|---|
| 437 | | - rq_addr = dma_zalloc_coherent(&adapter->pdev->dev, rq_size, |
|---|
| 438 | | - &rq_phys_addr, GFP_KERNEL); |
|---|
| 436 | + rq_addr = dma_alloc_coherent(&adapter->pdev->dev, rq_size, |
|---|
| 437 | + &rq_phys_addr, GFP_KERNEL); |
|---|
| 439 | 438 | if (!rq_addr) |
|---|
| 440 | 439 | return -ENOMEM; |
|---|
| 441 | 440 | |
|---|
| 442 | 441 | rsp_size = SIZEOF_CARDRSP_TX(struct qlcnic_cardrsp_tx_ctx); |
|---|
| 443 | | - rsp_addr = dma_zalloc_coherent(&adapter->pdev->dev, rsp_size, |
|---|
| 444 | | - &rsp_phys_addr, GFP_KERNEL); |
|---|
| 442 | + rsp_addr = dma_alloc_coherent(&adapter->pdev->dev, rsp_size, |
|---|
| 443 | + &rsp_phys_addr, GFP_KERNEL); |
|---|
| 445 | 444 | if (!rsp_addr) { |
|---|
| 446 | 445 | err = -ENOMEM; |
|---|
| 447 | 446 | goto out_free_rq; |
|---|
| .. | .. |
|---|
| 629 | 628 | int i, err, ring; |
|---|
| 630 | 629 | |
|---|
| 631 | 630 | if (dev->flags & QLCNIC_NEED_FLR) { |
|---|
| 632 | | - pci_reset_function(dev->pdev); |
|---|
| 631 | + err = pci_reset_function(dev->pdev); |
|---|
| 632 | + if (err) { |
|---|
| 633 | + dev_err(&dev->pdev->dev, |
|---|
| 634 | + "Adapter reset failed (%d). Please reboot\n", |
|---|
| 635 | + err); |
|---|
| 636 | + return err; |
|---|
| 637 | + } |
|---|
| 633 | 638 | dev->flags &= ~QLCNIC_NEED_FLR; |
|---|
| 634 | 639 | } |
|---|
| 635 | 640 | |
|---|
| .. | .. |
|---|
| 855 | 860 | struct qlcnic_cmd_args cmd; |
|---|
| 856 | 861 | size_t nic_size = sizeof(struct qlcnic_info_le); |
|---|
| 857 | 862 | |
|---|
| 858 | | - nic_info_addr = dma_zalloc_coherent(&adapter->pdev->dev, nic_size, |
|---|
| 859 | | - &nic_dma_t, GFP_KERNEL); |
|---|
| 863 | + nic_info_addr = dma_alloc_coherent(&adapter->pdev->dev, nic_size, |
|---|
| 864 | + &nic_dma_t, GFP_KERNEL); |
|---|
| 860 | 865 | if (!nic_info_addr) |
|---|
| 861 | 866 | return -ENOMEM; |
|---|
| 862 | 867 | |
|---|
| .. | .. |
|---|
| 909 | 914 | if (adapter->ahw->op_mode != QLCNIC_MGMT_FUNC) |
|---|
| 910 | 915 | return err; |
|---|
| 911 | 916 | |
|---|
| 912 | | - nic_info_addr = dma_zalloc_coherent(&adapter->pdev->dev, nic_size, |
|---|
| 913 | | - &nic_dma_t, GFP_KERNEL); |
|---|
| 917 | + nic_info_addr = dma_alloc_coherent(&adapter->pdev->dev, nic_size, |
|---|
| 918 | + &nic_dma_t, GFP_KERNEL); |
|---|
| 914 | 919 | if (!nic_info_addr) |
|---|
| 915 | 920 | return -ENOMEM; |
|---|
| 916 | 921 | |
|---|
| .. | .. |
|---|
| 964 | 969 | void *pci_info_addr; |
|---|
| 965 | 970 | int err = 0, i; |
|---|
| 966 | 971 | |
|---|
| 967 | | - pci_info_addr = dma_zalloc_coherent(&adapter->pdev->dev, pci_size, |
|---|
| 968 | | - &pci_info_dma_t, GFP_KERNEL); |
|---|
| 972 | + pci_info_addr = dma_alloc_coherent(&adapter->pdev->dev, pci_size, |
|---|
| 973 | + &pci_info_dma_t, GFP_KERNEL); |
|---|
| 969 | 974 | if (!pci_info_addr) |
|---|
| 970 | 975 | return -ENOMEM; |
|---|
| 971 | 976 | |
|---|
| .. | .. |
|---|
| 1078 | 1083 | return -EIO; |
|---|
| 1079 | 1084 | } |
|---|
| 1080 | 1085 | |
|---|
| 1081 | | - stats_addr = dma_zalloc_coherent(&adapter->pdev->dev, stats_size, |
|---|
| 1082 | | - &stats_dma_t, GFP_KERNEL); |
|---|
| 1086 | + stats_addr = dma_alloc_coherent(&adapter->pdev->dev, stats_size, |
|---|
| 1087 | + &stats_dma_t, GFP_KERNEL); |
|---|
| 1083 | 1088 | if (!stats_addr) |
|---|
| 1084 | 1089 | return -ENOMEM; |
|---|
| 1085 | 1090 | |
|---|
| .. | .. |
|---|
| 1134 | 1139 | if (mac_stats == NULL) |
|---|
| 1135 | 1140 | return -ENOMEM; |
|---|
| 1136 | 1141 | |
|---|
| 1137 | | - stats_addr = dma_zalloc_coherent(&adapter->pdev->dev, stats_size, |
|---|
| 1138 | | - &stats_dma_t, GFP_KERNEL); |
|---|
| 1142 | + stats_addr = dma_alloc_coherent(&adapter->pdev->dev, stats_size, |
|---|
| 1143 | + &stats_dma_t, GFP_KERNEL); |
|---|
| 1139 | 1144 | if (!stats_addr) |
|---|
| 1140 | 1145 | return -ENOMEM; |
|---|
| 1141 | 1146 | |
|---|