hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/scsi/be2iscsi/be_cmds.c
....@@ -1,15 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright 2017 Broadcom. All Rights Reserved.
34 * The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries.
45 *
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
- *
106 * Contact Information:
117 * linux-drivers@broadcom.com
12
- *
138 */
149
1510 #include <scsi/iscsi_proto.h>
....@@ -520,7 +515,7 @@
520515 **/
521516 tag_mem = &ctrl->ptag_state[tag].tag_mem_state;
522517 if (tag_mem->size) {
523
- pci_free_consistent(ctrl->pdev, tag_mem->size,
518
+ dma_free_coherent(&ctrl->pdev->dev, tag_mem->size,
524519 tag_mem->va, tag_mem->dma);
525520 tag_mem->size = 0;
526521 }
....@@ -963,7 +958,7 @@
963958 * @ctrl: ptr to ctrl_info
964959 * @cq: Completion Queue
965960 * @dq: Default Queue
966
- * @lenght: ring size
961
+ * @length: ring size
967962 * @entry_size: size of each entry in DEFQ
968963 * @is_header: Header or Data DEFQ
969964 * @ulp_num: Bind to which ULP
....@@ -1269,12 +1264,12 @@
12691264 struct be_sge *sge = nonembedded_sgl(wrb);
12701265 int status = 0;
12711266
1272
- nonemb_cmd.va = pci_alloc_consistent(ctrl->pdev,
1267
+ nonemb_cmd.va = dma_alloc_coherent(&ctrl->pdev->dev,
12731268 sizeof(struct be_mgmt_controller_attributes),
1274
- &nonemb_cmd.dma);
1269
+ &nonemb_cmd.dma, GFP_KERNEL);
12751270 if (nonemb_cmd.va == NULL) {
12761271 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",
12781273 __func__);
12791274 return -ENOMEM;
12801275 }
....@@ -1314,7 +1309,7 @@
13141309 "BG_%d : Failed in beiscsi_check_supported_fw\n");
13151310 mutex_unlock(&ctrl->mbox_lock);
13161311 if (nonemb_cmd.va)
1317
- pci_free_consistent(ctrl->pdev, nonemb_cmd.size,
1312
+ dma_free_coherent(&ctrl->pdev->dev, nonemb_cmd.size,
13181313 nonemb_cmd.va, nonemb_cmd.dma);
13191314
13201315 return status;