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: 14026983 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0C3C5C36002 for ; Mon, 24 Mar 2025 09:35:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WVfuTF53AS93x799qf83tnc58mxOCFNLU7/BOt38cVk=; b=e/E2CgipdAwIErWunXbLvTrkzW rgZtUkluI7HVUvI8ulVAraQwOXV66Gy2cz6AnWl6GAGjxtZQXJBJmjEPt43lUBzPZmcSqvq/vBDI/ tox0rWlIlTry3s0WQ2gbF0/kX6bsZHIXS6uYyHiCvh+E8rsEmHkQdDB0mUXf5Rkz+skdA5nm6xJr6 AK5sAKK7pjtckp/LKTGKMn3micbDdPOOF3VscG/WwslmdEzfGx8URRmDtRbsoJMGdD62HL8ovhlU2 xjPa0BMGSm+UGZrgbzhFyYrtJcL2EnzTbRg11dQZqHfuW0YniFUyysZgNexVnlljj9eTQxVKeU19K RtLEOqNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tweDI-00000002jH1-45W7; Mon, 24 Mar 2025 09:35:20 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1twe8S-00000002iUW-1N3b for linux-arm-kernel@lists.infradead.org; Mon, 24 Mar 2025 09:30:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 7A4CDA48787; Mon, 24 Mar 2025 09:24:50 +0000 (UTC) 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250324_023020_491538_9AC72FF8 X-CRM114-Status: GOOD ( 13.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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)