[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250120162020.67024-3-phasta@kernel.org>
Date: Mon, 20 Jan 2025 17:20:22 +0100
From: Philipp Stanner <phasta@...nel.org>
To: Jens Axboe <axboe@...nel.dk>,
Hannes Reinecke <hare@...e.de>,
Damien Le Moal <dlemoal@...nel.org>,
Philipp Stanner <phasta@...nel.org>,
John Garry <john.g.garry@...cle.com>,
Li Zetao <lizetao1@...wei.com>,
Al Viro <viro@...iv.linux.org.uk>
Cc: linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] block: mtip32xx: Remove unnecessary function calls
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@...nel.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(-)
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);
}
--
2.47.1
Powered by blists - more mailing lists