Commit d327a12e authored by Philipp Stanner's avatar Philipp Stanner Committed by Jakub Kicinski
Browse files

stmmac: Remove pcim_* functions for driver detach



Functions prefixed with "pcim_" are managed devres functions which
perform automatic cleanup once the driver unloads. It is, thus, not
necessary to call any cleanup functions in remove() callbacks.

Remove the pcim_ cleanup function calls in the remove() callbacks.

Signed-off-by: default avatarPhilipp Stanner <phasta@kernel.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarYanteng Si <si.yanteng@linux.dev>
Tested-by: default avatarHenry Chen <chenx97@aosc.io>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20250324092928.9482-5-phasta@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 9db2426a
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -619,7 +619,6 @@ static void loongson_dwmac_remove(struct pci_dev *pdev)
	struct net_device *ndev = dev_get_drvdata(&pdev->dev);
	struct stmmac_priv *priv = netdev_priv(ndev);
	struct loongson_data *ld;
	int i;

	ld = priv->plat->bsp_priv;
	stmmac_dvr_remove(&pdev->dev);
@@ -630,13 +629,6 @@ static void loongson_dwmac_remove(struct pci_dev *pdev)
	if (ld->loongson_id == DWMAC_CORE_LS_MULTICHAN)
		loongson_dwmac_msi_clear(pdev);

	for (i = 0; i < PCI_STD_NUM_BARS; i++) {
		if (pci_resource_len(pdev, i) == 0)
			continue;
		pcim_iounmap_regions(pdev, BIT(i));
		break;
	}

	pci_disable_device(pdev);
}

+1 −11
Original line number Diff line number Diff line
@@ -226,21 +226,11 @@ static int stmmac_pci_probe(struct pci_dev *pdev,
 * stmmac_pci_remove
 *
 * @pdev: platform device pointer
 * Description: this function calls the main to free the net resources
 * and releases the PCI resources.
 * Description: this function calls the main to free the net resources.
 */
static void stmmac_pci_remove(struct pci_dev *pdev)
{
	int i;

	stmmac_dvr_remove(&pdev->dev);

	for (i = 0; i < PCI_STD_NUM_BARS; i++) {
		if (pci_resource_len(pdev, i) == 0)
			continue;
		pcim_iounmap_regions(pdev, BIT(i));
		break;
	}
}

static int __maybe_unused stmmac_pci_suspend(struct device *dev)