From patchwork Wed Feb 26 08:52:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13991847 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 24A98C19778 for ; Wed, 26 Feb 2025 09:23:08 +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=A37Ebn8QUrOVpZewBJN7sg3PK69W8PeZTM9pkzq0eI0=; b=S4mnSGmZ28qH2mGSrbKunmMJA6 eNRrlmBrk5X/j0jI4fl8QS6YniazYLc7nylxqh0d7xE0tNgoFl3OZNEhSGzn3ESPVhv2y9Gr3eJoG LTZptxRcGu76L1eCcMru0YzmXcU8xYpPMhc5Zs48kLDk633PRILVqptYyEf08QppcORRWOk0zPKln GQwUeCAys9kT/UoqPjG1CZZcQleb/FDqOh8jyakC3xnC8CRjocIhaUGEmmzjP23kdotUqSqlYGDPt RVbLOslFpQrlllrYClZjzi8GDfdnWUG0BqpyaIzKnp3dpkTVB17nFzgcDTra2RnUdqgB7LaSmszPW XSdh5aVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tnDd3-000000033rA-3HGQ; Wed, 26 Feb 2025 09:22:57 +0000 Received: from tor.source.kernel.org ([2600:3c04::f03c:95ff:fe5e:7468]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tnD9Z-00000002y0n-38Mr for linux-arm-kernel@lists.infradead.org; Wed, 26 Feb 2025 08:52:29 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 935EC61291; Wed, 26 Feb 2025 08:52:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8F16C4CEE7; Wed, 26 Feb 2025 08:52:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740559948; bh=lIHNdIK6hPFeIvlmwhxstmnP1ls57wGiXfAx3JVAMPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gTowQrOCigkrCNEJ5MDYX1TfpdKJ7irp6D2SLGUimP7EB2DjqC7qTbvC6zHn4rxHk RV19+A7GI2mMdDQkBp+7lzM0p6WVpS9bOD3qG6Z9GKvrKjVguv9I8XsCGRAW9wkkDl AcVCmDTWJviFwngRasFTH6OnLXQqr3Nbp4/ohqCAoTuh0jiYEIFLHo3ugM0Gdy0gME cT1tdRfMOVMo6eeWmuELYJTv4yX5OSgbmR3Ca29QAif/ibjrYV3HZq2g87/8SDfzn/ k588T+6J+wTzvACZyu0kPuFjRzfv7nsQoHLsmjSA1UiCVKeBez2s7d8BYHIScSni3n 80oSu7NeH49/A== From: Philipp Stanner To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Huacai Chen , Yanteng Si , Yinggang Gu , Feiyang Chen , Philipp Stanner , Jiaxun Yang , Qing Zhang 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 Subject: [PATCH net-next v4 3/4] stmmac: Remove pcim_* functions for driver detach Date: Wed, 26 Feb 2025 09:52:07 +0100 Message-ID: <20250226085208.97891-4-phasta@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250226085208.97891-1-phasta@kernel.org> References: <20250226085208.97891-1-phasta@kernel.org> MIME-Version: 1.0 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 --- 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 e2959ac5c1ca..5d7746d787ac 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c @@ -603,7 +603,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); @@ -614,13 +613,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)