| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2017 Broadcom. All Rights Reserved. |
|---|
| 3 | 4 | * The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries. |
|---|
| 4 | 5 | * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or |
|---|
| 6 | | - * modify it under the terms of the GNU General Public License version 2 |
|---|
| 7 | | - * as published by the Free Software Foundation. The full GNU General |
|---|
| 8 | | - * Public License is included in this distribution in the file called COPYING. |
|---|
| 9 | | - * |
|---|
| 10 | 6 | * Contact Information: |
|---|
| 11 | 7 | * linux-drivers@broadcom.com |
|---|
| 12 | | - * |
|---|
| 13 | 8 | */ |
|---|
| 14 | 9 | |
|---|
| 15 | 10 | #include <scsi/iscsi_proto.h> |
|---|
| .. | .. |
|---|
| 520 | 515 | **/ |
|---|
| 521 | 516 | tag_mem = &ctrl->ptag_state[tag].tag_mem_state; |
|---|
| 522 | 517 | if (tag_mem->size) { |
|---|
| 523 | | - pci_free_consistent(ctrl->pdev, tag_mem->size, |
|---|
| 518 | + dma_free_coherent(&ctrl->pdev->dev, tag_mem->size, |
|---|
| 524 | 519 | tag_mem->va, tag_mem->dma); |
|---|
| 525 | 520 | tag_mem->size = 0; |
|---|
| 526 | 521 | } |
|---|
| .. | .. |
|---|
| 963 | 958 | * @ctrl: ptr to ctrl_info |
|---|
| 964 | 959 | * @cq: Completion Queue |
|---|
| 965 | 960 | * @dq: Default Queue |
|---|
| 966 | | - * @lenght: ring size |
|---|
| 961 | + * @length: ring size |
|---|
| 967 | 962 | * @entry_size: size of each entry in DEFQ |
|---|
| 968 | 963 | * @is_header: Header or Data DEFQ |
|---|
| 969 | 964 | * @ulp_num: Bind to which ULP |
|---|
| .. | .. |
|---|
| 1269 | 1264 | struct be_sge *sge = nonembedded_sgl(wrb); |
|---|
| 1270 | 1265 | int status = 0; |
|---|
| 1271 | 1266 | |
|---|
| 1272 | | - nonemb_cmd.va = pci_alloc_consistent(ctrl->pdev, |
|---|
| 1267 | + nonemb_cmd.va = dma_alloc_coherent(&ctrl->pdev->dev, |
|---|
| 1273 | 1268 | sizeof(struct be_mgmt_controller_attributes), |
|---|
| 1274 | | - &nonemb_cmd.dma); |
|---|
| 1269 | + &nonemb_cmd.dma, GFP_KERNEL); |
|---|
| 1275 | 1270 | if (nonemb_cmd.va == NULL) { |
|---|
| 1276 | 1271 | beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, |
|---|
| 1277 | | - "BG_%d : pci_alloc_consistent failed in %s\n", |
|---|
| 1272 | + "BG_%d : dma_alloc_coherent failed in %s\n", |
|---|
| 1278 | 1273 | __func__); |
|---|
| 1279 | 1274 | return -ENOMEM; |
|---|
| 1280 | 1275 | } |
|---|
| .. | .. |
|---|
| 1314 | 1309 | "BG_%d : Failed in beiscsi_check_supported_fw\n"); |
|---|
| 1315 | 1310 | mutex_unlock(&ctrl->mbox_lock); |
|---|
| 1316 | 1311 | if (nonemb_cmd.va) |
|---|
| 1317 | | - pci_free_consistent(ctrl->pdev, nonemb_cmd.size, |
|---|
| 1312 | + dma_free_coherent(&ctrl->pdev->dev, nonemb_cmd.size, |
|---|
| 1318 | 1313 | nonemb_cmd.va, nonemb_cmd.dma); |
|---|
| 1319 | 1314 | |
|---|
| 1320 | 1315 | return status; |
|---|