From patchwork Mon Mar 24 09:29:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 14026975 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C31B225DCEF; Mon, 24 Mar 2025 09:30:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742808619; cv=none; b=WT/dtA9l/GDEPYLHqZo3qld3YuX7OVeL3A5KNAmv/+MosjyZ09DXs+64AZkaKyBEWc8v7abhaTGjGtn3ttaX4gYt+8RpJgWTxHMKvTwfM0GA2NuiVuoyVyU2PwIKcsaVyKID8VBS/ZMdrIqbD7n+syDWzfs2O6cJsm6NeG+mygc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742808619; c=relaxed/simple; bh=psaOY5ZeahrGZpzq30alFkBQeU/NMOJb98eC6ZEqwbY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tnDQL0gDWe7ZoZKCiGyc0WwknCDTONHTX18DDsNBgKr/TUaHeqsGJNX2O4Fy/+5EPCrFF3iJCrJyc2LXXG14JI43lWSLvN4FPlmhdgdI4KHE7+FBJ90q6p+KtbBhnkMErQswlSiuC3VIzYILVaqJaho4Jd7Wx3h7Ov5b42IexmM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ne+EECTv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ne+EECTv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DA39C4CEE4; Mon, 24 Mar 2025 09:30:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742808619; bh=psaOY5ZeahrGZpzq30alFkBQeU/NMOJb98eC6ZEqwbY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ne+EECTvB01cWO85loW2xuaenERgxUwoB6VUIjmaVrCWD+hvF2ToBYezsihD58Qcz 5jMvH4hxOZpLf7d9XZF28HUbJwioHic72EsEi2Gn3i3yTwY9m3F9xgj4UNWMHydoM0 0+7ygZFTa9qhNgqhI/+ZjezQ6AVipjE530KQlChwiNd7qNuKMqmzC2c1NN52kqwdsA f1y/8b86HIG7XPexUudNEXhfsOSv6TNI3RtykSGudWvVJEnXjKjcXKLJRsG02RDwDL Tx/Nd4G67kakPn0iupwb8vNZ/+P+4/WWDHajxeaz9yDeVH4fx2i3edz79D66GDQZmG osauy+8wB6s6w== From: Philipp Stanner To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Huacai Chen , Yanteng Si , Serge Semin , Yinggang Gu Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Philipp Stanner , Andrew Lunn , Henry Chen , Jacob Keller Subject: [PATCH net-next v4 2/3] stmmac: Remove pcim_* functions for driver detach Date: Mon, 24 Mar 2025 10:29:29 +0100 Message-ID: <20250324092928.9482-5-phasta@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250324092928.9482-2-phasta@kernel.org> References: <20250324092928.9482-2-phasta@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org 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: Philipp Stanner Reviewed-by: Andrew Lunn Reviewed-by: Yanteng Si Tested-by: Henry Chen Reviewed-by: Jacob Keller --- drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c | 8 -------- drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c | 12 +----------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c index 7e8495547934..e015e54d9190 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c @@ -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); } diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c index 352b01678c22..1637c8139b9d 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c @@ -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)