forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/scsi/csiostor/csio_init.c
....@@ -154,27 +154,20 @@
154154 /*
155155 * csio_dfs_destroy - Destroys per-hw debugfs.
156156 */
157
-static int
157
+static void
158158 csio_dfs_destroy(struct csio_hw *hw)
159159 {
160
- if (hw->debugfs_root)
161
- debugfs_remove_recursive(hw->debugfs_root);
162
-
163
- return 0;
160
+ debugfs_remove_recursive(hw->debugfs_root);
164161 }
165162
166163 /*
167164 * csio_dfs_init - Debug filesystem initialization for the module.
168165 *
169166 */
170
-static int
167
+static void
171168 csio_dfs_init(void)
172169 {
173170 csio_debugfs_root = debugfs_create_dir(KBUILD_MODNAME, NULL);
174
- if (!csio_debugfs_root)
175
- pr_warn("Could not create debugfs entry, continuing\n");
176
-
177
- return 0;
178171 }
179172
180173 /*
....@@ -210,11 +203,11 @@
210203 pci_set_master(pdev);
211204 pci_try_set_mwi(pdev);
212205
213
- if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
214
- pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
215
- } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
216
- pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
217
- } else {
206
+ rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
207
+ if (rv)
208
+ rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
209
+ if (rv) {
210
+ rv = -ENODEV;
218211 dev_err(&pdev->dev, "No suitable DMA available.\n");
219212 goto err_release_regions;
220213 }
....@@ -258,7 +251,6 @@
258251 csio_hw_exit_workers(struct csio_hw *hw)
259252 {
260253 cancel_work_sync(&hw->evtq_work);
261
- flush_scheduled_work();
262254 }
263255
264256 static int
....@@ -537,7 +529,7 @@
537529 goto err_free_hw;
538530
539531 /* Get the start address of registers from BAR 0 */
540
- hw->regstart = ioremap_nocache(pci_resource_start(pdev, 0),
532
+ hw->regstart = ioremap(pci_resource_start(pdev, 0),
541533 pci_resource_len(pdev, 0));
542534 if (!hw->regstart) {
543535 csio_err(hw, "Could not map BAR 0, regstart = %p\n",
....@@ -590,7 +582,7 @@
590582 * @hw: The HW module.
591583 * @dev: The device associated with this invocation.
592584 * @probe: Called from probe context or not?
593
- * @os_pln: Parent lnode if any.
585
+ * @pln: Parent lnode if any.
594586 *
595587 * Allocates lnode structure via scsi_host_alloc, initializes
596588 * shost, initializes lnode module and registers with SCSI ML
....@@ -1102,7 +1094,6 @@
11021094 pci_set_master(pdev);
11031095 pci_restore_state(pdev);
11041096 pci_save_state(pdev);
1105
- pci_cleanup_aer_uncorrect_error_status(pdev);
11061097
11071098 /* Bring HW s/m to ready state.
11081099 * but don't resume IOs.