From patchwork Mon Mar 24 09:29:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 14026984 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 11520C36002 for ; Mon, 24 Mar 2025 09:37:15 +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=94tO430Kd0jy3So1vCLinJPYHabckYaJqEFNmILpaJE=; b=DlNBaQjk+wwYLIubPtOgbJp4F4 DKQ2Po5Ra+kOctWK9DvJfddq9vqpD2hPva6kAXrPYWrVhXxlCIbmYSxgaJ7s9KFhpdrftBfd5+hzd 8Vl5mhAzZTPYLe2A8RStPBPIolHFYRffbfpkELXpAE02es4VPpsB8YVz14+YPCgNilRt+5SJnqAWj dFw3mzzGnjGhq79bAs+TnVCzNk4Sb7K8aYhadsmf5MaRpioOhzx61Cmthci4Aqab52lI/lArSfFOO 3UP61gp9/crsar/sTQN7hc9vOp1b6nY8QPpKsP0nxJhTFPFgvE1gNQLWqXFl+y11heS7wuojPRche eFcDFZnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tweF0-00000002jb4-3FDd; Mon, 24 Mar 2025 09:37:06 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1twe8X-00000002iVG-0QI8 for linux-arm-kernel@lists.infradead.org; Mon, 24 Mar 2025 09:30:26 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7EC1A5C2FAE; Mon, 24 Mar 2025 09:28:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD1E9C4CEDD; Mon, 24 Mar 2025 09:30:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1742808624; bh=IPzrS0/Zcd1NgbTKD2p6gprmFogxoNJ569d846NwIW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ijNDJqpOO/9i/N70VDeLvEcXIYYBfUVNZaMbGsiH+SN6JXsWEQNTYaU5Yg56bkDrq ASlVFNPr8XpZVXQbahLP5/XBLN6Vx9RDzHQKrh1XtCDR5FH8VEDTp+hM3jcvJotkZn Y9jx6KGtekRJi97hnODq2Qm2TsRIUYsPsZ+4w6RDLu5DhQuYQAeESzjUGqQUBo+Fpr cFBLJPAZjIjR9Xg6vbNAZtuiPACjWDcXk2OwCWR3gGSHBWEZmMghj+Cvty9uYa2ng1 Kl08LPtdM9Q6vSI829TTCo8Fd+e9OJ+64lpH2n35grdfFUhwmitVXWeAWCTLH3zIkW hfGs94nL4i1cQ== 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 , Huacai Chen , Henry Chen , Jacob Keller Subject: [PATCH net-next v4 3/3] stmmac: Replace deprecated PCI functions Date: Mon, 24 Mar 2025 10:29:30 +0100 Message-ID: <20250324092928.9482-6-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_023025_253142_57760F3D X-CRM114-Status: GOOD ( 14.25 ) 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 The PCI functions - pcim_iomap_regions() and - pcim_iomap_table() have been deprecated. Replace them with their successor function, pcim_iomap_region(). Make variable declaration order at closeby places comply with reverse christmas tree order. Reviewed-by: Andrew Lunn Reviewed-by: Huacai Chen Tested-by: Henry Chen Signed-off-by: Philipp Stanner 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, 8 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c index e015e54d9190..1a93787056a7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c @@ -533,8 +533,8 @@ static int loongson_dwmac_fix_reset(void *priv, void __iomem *ioaddr) static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id *id) { struct plat_stmmacenet_data *plat; + struct stmmac_resources res = {}; struct stmmac_pci_info *info; - struct stmmac_resources res; struct loongson_data *ld; int ret; @@ -566,13 +566,11 @@ static int loongson_dwmac_probe(struct pci_dev *pdev, const struct pci_device_id pci_set_master(pdev); /* Get the base address of device */ - ret = pcim_iomap_regions(pdev, BIT(0), DRIVER_NAME); + res.addr = pcim_iomap_region(pdev, 0, DRIVER_NAME); + ret = PTR_ERR_OR_ZERO(res.addr); if (ret) goto err_disable_device; - memset(&res, 0, sizeof(res)); - res.addr = pcim_iomap_table(pdev)[0]; - plat->bsp_priv = ld; plat->setup = loongson_dwmac_setup; plat->fix_soc_reset = loongson_dwmac_fix_reset; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c index 1637c8139b9d..9c1b54b701f7 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c @@ -155,9 +155,9 @@ static int stmmac_pci_probe(struct pci_dev *pdev, { struct stmmac_pci_info *info = (struct stmmac_pci_info *)id->driver_data; struct plat_stmmacenet_data *plat; - struct stmmac_resources res; - int i; + struct stmmac_resources res = {}; int ret; + int i; plat = devm_kzalloc(&pdev->dev, sizeof(*plat), GFP_KERNEL); if (!plat) @@ -192,9 +192,9 @@ static int stmmac_pci_probe(struct pci_dev *pdev, for (i = 0; i < PCI_STD_NUM_BARS; i++) { if (pci_resource_len(pdev, i) == 0) continue; - ret = pcim_iomap_regions(pdev, BIT(i), pci_name(pdev)); - if (ret) - return ret; + res.addr = pcim_iomap_region(pdev, i, STMMAC_RESOURCE_NAME); + if (IS_ERR(res.addr)) + return PTR_ERR(res.addr); break; } @@ -204,8 +204,6 @@ static int stmmac_pci_probe(struct pci_dev *pdev, if (ret) return ret; - memset(&res, 0, sizeof(res)); - res.addr = pcim_iomap_table(pdev)[i]; res.wol_irq = pdev->irq; res.irq = pdev->irq;