From patchwork Thu Mar 13 16:14:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 14015551 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 BB49DC282EC for ; Thu, 13 Mar 2025 17:14:37 +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=1tLcSAAojdRxzgqwW/BGx6mlvm ZROVQmWquEvHFjDaNx8uzp8cZH3bPaY1U1djL5C5znaeuVz2Mi5NN7QcY6gZUx7rRklc027jbUQs9 EA8wxxj4YvIDCJRryRryQ8pb3iM3LMy1jP99jMVKVPyUAqx2F0pf1nnWhxS0WcCUkyTeWRs2fZ+dz RYr9N2sFFJTHPjrFBAKGkIqtNWIMcbcROZrxHU1Ih8xoMGo5ocRuQerQz+5mevrl0bWK2/sgwh3la hbOEjOMUESfeIvoi3VZopcxgpiJjU6r3rcxZtJN7w5nV6t/YmETkGePC6VewgkYxvbltRPkdX538H jkN70opQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tsm8X-0000000BwoQ-2Ho9; Thu, 13 Mar 2025 17:14:25 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tslCo-0000000Bmrn-2G66 for linux-arm-kernel@lists.infradead.org; Thu, 13 Mar 2025 16:14:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id E873AA474BF; Thu, 13 Mar 2025 16:09:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 344ECC4CEEB; Thu, 13 Mar 2025 16:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741882485; bh=lIHNdIK6hPFeIvlmwhxstmnP1ls57wGiXfAx3JVAMPs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QBzVQKD6Svv3aG0hcCqbk3fiNaZGQyvt8d3RC0Q1h2bDF3ukGOcLHRbjpszA2HMJY xYCvzlubxxkJzthlxcAYaXFaBi429vOLx6+lkZotUBR0Jo2dl4L96LsmvkEh0bOcHd ditNl2D+0gqwRdtF6btsu11+kdTvr/HlnGhewLkOBYHPBCeH2oN2tIRtDORPG8a4NE sjbXXu5USkuTe9uEwlTNAq4q9nhsZRBxJ2hGdNUsdot9uirwktObCpW+/ZaabXKYAV HxaQ15diI4jWCcUhEAkKNaSygEXdWsRda2dFuiDYGkXlASesP1qFQzWKpawFUDrRL4 pKLeu/wbKDDbg== From: Philipp Stanner To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Alexandre Torgue , Yanteng Si , Huacai Chen , Yinggang Gu , Serge Semin , Philipp Stanner 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 2/3] stmmac: Remove pcim_* functions for driver detach Date: Thu, 13 Mar 2025 17:14:22 +0100 Message-ID: <20250313161422.97174-4-phasta@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250313161422.97174-2-phasta@kernel.org> References: <20250313161422.97174-2-phasta@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250313_091446_708497_2E44108F X-CRM114-Status: GOOD ( 13.06 ) 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 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)