forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/scsi/csiostor/csio_lnode.c
....@@ -1187,7 +1187,6 @@
11871187 break;
11881188
11891189 case CSIO_LNE_LINK_DOWN:
1190
- /* Fall through */
11911190 case CSIO_LNE_DOWN_LINK:
11921191 csio_set_state(&ln->sm, csio_lns_uninit);
11931192 if (csio_is_phys_ln(ln)) {
....@@ -1848,8 +1847,8 @@
18481847 /* Allocate Dma buffers for FDMI response Payload */
18491848 dma_buf = &ln->mgmt_req->dma_buf;
18501849 dma_buf->len = 2048;
1851
- dma_buf->vaddr = pci_alloc_consistent(hw->pdev, dma_buf->len,
1852
- &dma_buf->paddr);
1850
+ dma_buf->vaddr = dma_alloc_coherent(&hw->pdev->dev, dma_buf->len,
1851
+ &dma_buf->paddr, GFP_KERNEL);
18531852 if (!dma_buf->vaddr) {
18541853 csio_err(hw, "Failed to alloc DMA buffer for FDMI!\n");
18551854 kfree(ln->mgmt_req);
....@@ -1876,7 +1875,7 @@
18761875
18771876 dma_buf = &ln->mgmt_req->dma_buf;
18781877 if (dma_buf->vaddr)
1879
- pci_free_consistent(hw->pdev, dma_buf->len, dma_buf->vaddr,
1878
+ dma_free_coherent(&hw->pdev->dev, dma_buf->len, dma_buf->vaddr,
18801879 dma_buf->paddr);
18811880
18821881 kfree(ln->mgmt_req);
....@@ -1992,7 +1991,7 @@
19921991 csio_ln_init(struct csio_lnode *ln)
19931992 {
19941993 int rv = -EINVAL;
1995
- struct csio_lnode *rln, *pln;
1994
+ struct csio_lnode *pln;
19961995 struct csio_hw *hw = csio_lnode_to_hw(ln);
19971996
19981997 csio_init_state(&ln->sm, csio_lns_uninit);
....@@ -2022,7 +2021,6 @@
20222021 * THe rest is common for non-root physical and NPIV lnodes.
20232022 * Just get references to all other modules
20242023 */
2025
- rln = csio_root_lnode(ln);
20262024
20272025 if (csio_is_npiv_ln(ln)) {
20282026 /* NPIV */
....@@ -2069,10 +2067,9 @@
20692067 ln->fcfinfo = NULL;
20702068 }
20712069
2072
-/**
2070
+/*
20732071 * csio_lnode_init - Initialize the members of an lnode.
20742072 * @ln: lnode
2075
- *
20762073 */
20772074 int
20782075 csio_lnode_init(struct csio_lnode *ln, struct csio_hw *hw,