Skip to contentSkip to conversation

spi: dw-pci: remove redundant pci_free_irq_vectors() calls

PATCH In review Felix Gu 2 participants 2 messages May 29 – Jun 9 SPI

lore
Share & tools
lore

Felix Gu

author
#0 lore raw

PATCH 1/1 spi: dw-pci: remove redundant pci_free_irq_vectors() calls

The driver uses pcim_enable_device(), so IRQ vectors are automatically freed by devres on driver detach. The explicit pci_free_irq_vectors() calls in the probe error path and remove function are redundant.

Drop them and the now-unused error label.

---
 drivers/spi/spi-dw-pci.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
drivers/spi/spi-dw-pci.c +3 -9
index 7f002d5e5b88..bfb874f96a26 100644
@@ -120,16 +120,15 @@ static int dw_spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *en
 		if (desc->setup) {
 			ret = desc->setup(dws);
 			if (ret)
-				goto err_free_irq_vectors;
+				return ret;
 		}
 	} else {
-		ret = -ENODEV;
-		goto err_free_irq_vectors;
+		return -ENODEV;
 	}
 
 	ret = dw_spi_add_controller(&pdev->dev, dws);
 	if (ret)
-		goto err_free_irq_vectors;
+		return ret;
 
 	/* PCI hook and SPI hook use the same drv data */
 	pci_set_drvdata(pdev, dws);
@@ -143,10 +142,6 @@ static int dw_spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *en
 	pm_runtime_allow(&pdev->dev);
 
 	return 0;
-
-err_free_irq_vectors:
-	pci_free_irq_vectors(pdev);
-	return ret;
 }
 
 static void dw_spi_pci_remove(struct pci_dev *pdev)
@@ -157,7 +152,6 @@ static void dw_spi_pci_remove(struct pci_dev *pdev)
 	pm_runtime_get_noresume(&pdev->dev);
 
 	dw_spi_remove_controller(dws);
-	pci_free_irq_vectors(pdev);
 }
 
 #ifdef CONFIG_PM_SLEEP

---
base-commit: f7af91adc230aa99e23330ecf85bc9badd9780ad
change-id: 20260530-dw-pci-d756a48bf3a2

Best regards,

Signature · 1 line
Felix Gu <[email protected]>
maintainer
#1 lore raw
Quoted 1 line · Felix Gu

spi: dw-pci: remove redundant pci_free_irq_vectors() calls

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.2

Thanks!

[1/1] spi: dw-pci: remove redundant pci_free_irq_vectors() calls

      https://git.kernel.org/broonie/spi/c/af4310929afc

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark