From nobody Thu Dec 18 18:19:11 2025 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 EA0A32690C9; Thu, 13 Mar 2025 16:14:45 +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=1741882486; cv=none; b=QhdeMeEyvA6skdePNpygzP87u/oGzEB+xPSc7Sf4aABAkMQue+raWVfGD6GKLauX9tRaJ3xM2YPP8yG8B5o5sRVXoSNhusX+N7NPy//QMDldkbXAAho1WuUKj2atYprbjKBsBC61MVx+2QJ/J7FdK1iLLHAZlQEyg2SQf2r4zTE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741882486; c=relaxed/simple; bh=lIHNdIK6hPFeIvlmwhxstmnP1ls57wGiXfAx3JVAMPs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GFFPUlp/PPMQOjiGWPEqI89Irb9t/xd0IY3zFH1pDiSUlsi2zjudQWUJ1MAE4Yf+gdkYqodtpTydGdMIslh5CCxWKYcyMjs0h2axRWwN8h+YsGZQItRyuMiZS9i7x+8DqYNlt6631Fq+ThGkjnyzaP5s221Vm0DZwFgrLI/NbZw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QBzVQKD6; 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="QBzVQKD6" 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D dev_get_drvdata(&pdev->dev); struct stmmac_priv *priv =3D netdev_priv(ndev); struct loongson_data *ld; - int i; =20 ld =3D 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 =3D=3D DWMAC_CORE_LS_MULTICHAN) loongson_dwmac_msi_clear(pdev); =20 - for (i =3D 0; i < PCI_STD_NUM_BARS; i++) { - if (pci_resource_len(pdev, i) =3D=3D 0) - continue; - pcim_iounmap_regions(pdev, BIT(i)); - break; - } - pci_disable_device(pdev); } =20 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 =3D 0; i < PCI_STD_NUM_BARS; i++) { - if (pci_resource_len(pdev, i) =3D=3D 0) - continue; - pcim_iounmap_regions(pdev, BIT(i)); - break; - } } =20 static int __maybe_unused stmmac_pci_suspend(struct device *dev) --=20 2.48.1