diff mbox series

block: mtip32xx: Remove unnecessary function calls

Message ID 20250120162020.67024-3-phasta@kernel.org (mailing list archive)
State New
Headers show
Series block: mtip32xx: Remove unnecessary function calls | expand

Commit Message

Philipp Stanner Jan. 20, 2025, 4:20 p.m. UTC
pcim_iounmap_regions() does not have to be called, because the regions
are automatically unmapped since they were mapped with managed
functions. Moreover, that function is deprecated anyways.

Furthermore, setting the drvdata to NULL is unnecessary in a driver
remove() function.

Remove the unnecessary calls.

Signed-off-by: Philipp Stanner <phasta@kernel.org>
---
This patch had been around before in a series [1], but I unfortunately
messed it up and caused a race [2], which is why this patch here exists.
It's independent and fixes the rest of the pcim_ API up in this driver
once and for all :)

P.

[1] https://lore.kernel.org/all/20241016094911.24818-6-pstanner@redhat.com/
[2] https://lore.kernel.org/all/20241107162459.71e0288a@canb.auug.org.au/
---
 drivers/block/mtip32xx/mtip32xx.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Comments

Damien Le Moal Jan. 22, 2025, 6:02 a.m. UTC | #1
On 1/21/25 1:20 AM, Philipp Stanner wrote:
> pcim_iounmap_regions() does not have to be called, because the regions
> are automatically unmapped since they were mapped with managed
> functions. Moreover, that function is deprecated anyways.
> 
> Furthermore, setting the drvdata to NULL is unnecessary in a driver
> remove() function.
> 
> Remove the unnecessary calls.
> 
> Signed-off-by: Philipp Stanner <phasta@kernel.org>

Looks OK to me.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
diff mbox series

Patch

diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c
index 43701b7b10a7..aa9badb9a51d 100644
--- a/drivers/block/mtip32xx/mtip32xx.c
+++ b/drivers/block/mtip32xx/mtip32xx.c
@@ -3718,7 +3718,7 @@  static int mtip_pci_probe(struct pci_dev *pdev,
 	rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
 	if (rv) {
 		dev_warn(&pdev->dev, "64-bit DMA enable failed\n");
-		goto setmask_err;
+		goto iomap_err;
 	}
 
 	/* Copy the info we may need later into the private data structure. */
@@ -3734,7 +3734,7 @@  static int mtip_pci_probe(struct pci_dev *pdev,
 	if (!dd->isr_workq) {
 		dev_warn(&pdev->dev, "Can't create wq %d\n", dd->instance);
 		rv = -ENOMEM;
-		goto setmask_err;
+		goto iomap_err;
 	}
 
 	memset(cpu_list, 0, sizeof(cpu_list));
@@ -3831,8 +3831,6 @@  static int mtip_pci_probe(struct pci_dev *pdev,
 		drop_cpu(dd->work[1].cpu_binding);
 		drop_cpu(dd->work[2].cpu_binding);
 	}
-setmask_err:
-	pcim_iounmap_regions(pdev, 1 << MTIP_ABAR);
 
 iomap_err:
 	kfree(dd);
@@ -3907,10 +3905,6 @@  static void mtip_pci_remove(struct pci_dev *pdev)
 	}
 
 	pci_disable_msi(pdev);
-
-	pcim_iounmap_regions(pdev, 1 << MTIP_ABAR);
-	pci_set_drvdata(pdev, NULL);
-
 	put_disk(dd->disk);
 }