From nobody Wed Nov 27 04:39:19 2024 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 28D5315383F for ; Mon, 14 Oct 2024 07:53:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728892425; cv=none; b=qZ8UY1vVbnJiw+5F/TbFb1Pa61UlR6hraXdTuY+xFRp6v6rjuVexNOLHh0gVTZkABzNWSR8OyLXITGa7p08o/WZtTSYVQa2FEH9bonk1fe3AX6dwvAP4YjzAOLXiWNF7BkU4E2mxUGm3hyFn4/zYhnlMhs21ARfAJDCuGe2qhow= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728892425; c=relaxed/simple; bh=MtLuBgpfK91JYPjxSh1y78rHTuZ0TUA7P/TTgNSltBI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d78g0VGR7ZDgF7pwcplXOZRVd99ruMF1TGwKCClc9uWl+PHEhwq21hwUO2/9hmAaTE8NY8vib+12D6EX98FpfXV/pwzeMA7Hii9u6XsyM8ClbxB/HmcWkqh3x9CB0bOAZOtqq0mEK0V2+ZqeWVp+OthjI4W9lfiHbcdEIbs6Jtg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ckGtDr2t; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ckGtDr2t" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728892422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KQWRbKLTC4XrThcJn35sX444PmLxXwEeXK7ltjcDvQs=; b=ckGtDr2tj2c/bdT8aZMO8Ej5Yp448CINPsuXQtXg9RhgsXq+tco1yYrUOynmF0PJuV9pmh H3V7tDZqrrEYpYXTvfQ7flo2wjf4g4NUpAh/PQ7uDFrtIyN5b8VSmkb2f5awSXqJm6bnzi Ym4N56JHCZUIdcuwVo6LRrOjdzpfLBA= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-508-VovmmGWONd6z8CX_gGK2Lg-1; Mon, 14 Oct 2024 03:53:40 -0400 X-MC-Unique: VovmmGWONd6z8CX_gGK2Lg-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a9a0ac0e554so69326066b.1 for ; Mon, 14 Oct 2024 00:53:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728892419; x=1729497219; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KQWRbKLTC4XrThcJn35sX444PmLxXwEeXK7ltjcDvQs=; b=jO8UH7h57QvwuhQ1sxPHLMz7Z+3l7oz3Lwz08SrPFxIOJHAxhQp50RI8Utg4+pmxa0 04rvOtTBwi6U7+urEldM+N2OYeCAlfsIKE+Q/qQfdxbEXuP785bWTDewpwxMSUyojmph 5lWvtHL/U0mAAHE/TvelM8iLzD92kphgW24xJcmPz851Uno6Ok6/fHqfkxjIwjZlNbyM hxRD6+ILu3zxBeUe/SBoJwnBQCAy+DB4L39pybL9hVnl0fjOnucf9SAeywKC9isyy1hu KcGoCTU/u0DFjWPTmJK+yKJmyRmf+BrIXCCGjJghoKAaAzsj6zO6Lf8Ty9aJke5Sf+hs 73Uw== X-Forwarded-Encrypted: i=1; AJvYcCXD+U8cWLBFpwkeBLwA6ApNE7YqgaYrXvNsvmTMWWTSmvRa6gpfUKwLV/t8R+0GmT9dZseTwE4NUjBJdjA=@vger.kernel.org X-Gm-Message-State: AOJu0YyjeD0p/N++prXRhBRCf3GC3c6IzqteGvbrAEtW6ZezpRTbSbFp PQadhJGXco2OBtZvNZkrPc4narn2p//3TphQt0iyKcMIm6hUfmPWjq6AkTjwA1qLH9/XkHbeWFN JFHSL4JFjQA/S0O0gupIHwUx2sYxt7izF2Oo/AQUYbDzFrVN1U+aUYrqVn6za9w== X-Received: by 2002:a17:907:ea9:b0:a99:f5d8:726 with SMTP id a640c23a62f3a-a99f5d80ac6mr482028766b.23.1728892419442; Mon, 14 Oct 2024 00:53:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvo9dhhDKP1a2Qpqa18CL2nkvdiAgPC9PHZxg9N8VcO3KGLNh5KOfMatm+wb44wJX1LuKwdg== X-Received: by 2002:a17:907:ea9:b0:a99:f5d8:726 with SMTP id a640c23a62f3a-a99f5d80ac6mr482024366b.23.1728892418998; Mon, 14 Oct 2024 00:53:38 -0700 (PDT) Received: from eisenberg.fritz.box (200116b82d3798001d5778cfc1aeb0b3.dip.versatel-1u1.de. [2001:16b8:2d37:9800:1d57:78cf:c1ae:b0b3]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99f86fa986sm243291666b.92.2024.10.14.00.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 00:53:38 -0700 (PDT) From: Philipp Stanner To: Jens Axboe , Wu Hao , Tom Rix , Moritz Fischer , Xu Yilun , Andy Shevchenko , Linus Walleij , Bartosz Golaszewski , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Bjorn Helgaas , Richard Cochran , Damien Le Moal , Hannes Reinecke , Al Viro , Keith Busch , Philipp Stanner , Li Zetao Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org, linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v7 3/5] block: mtip32xx: Replace deprecated PCI functions Date: Mon, 14 Oct 2024 09:53:24 +0200 Message-ID: <20241014075329.10400-4-pstanner@redhat.com> X-Mailer: git-send-email 2.46.2 In-Reply-To: <20241014075329.10400-1-pstanner@redhat.com> References: <20241014075329.10400-1-pstanner@redhat.com> 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" pcim_iomap_regions() and pcim_iomap_table() have been deprecated by the PCI subsystem in commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()"). In mtip32xx, these functions can easily be replaced by their respective successors, pcim_request_region() and pcim_iomap(). Moreover, the driver's calls to pcim_iounmap_regions() in probe()'s error path and in remove() are not necessary. Cleanup can be performed by PCI devres automatically. Replace pcim_iomap_regions() and pcim_iomap_table(). Remove the calls to pcim_iounmap_regions(). Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko Reviewed-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mti= p32xx.c index 223faa9d5ffd..a10a87609310 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -2701,7 +2701,9 @@ static int mtip_hw_init(struct driver_data *dd) int rv; unsigned long timeout, timetaken; =20 - dd->mmio =3D pcim_iomap_table(dd->pdev)[MTIP_ABAR]; + dd->mmio =3D pcim_iomap(dd->pdev, MTIP_ABAR, 0); + if (!dd->mmio) + return -ENOMEM; =20 mtip_detect_product(dd); if (dd->product_type =3D=3D MTIP_PRODUCT_UNKNOWN) { @@ -3707,14 +3709,14 @@ static int mtip_pci_probe(struct pci_dev *pdev, rv =3D pcim_enable_device(pdev); if (rv < 0) { dev_err(&pdev->dev, "Unable to enable device\n"); - goto iomap_err; + goto setmask_err; } =20 - /* Map BAR5 to memory. */ - rv =3D pcim_iomap_regions(pdev, 1 << MTIP_ABAR, MTIP_DRV_NAME); + /* Request BAR5. */ + rv =3D pcim_request_region(pdev, MTIP_ABAR, MTIP_DRV_NAME); if (rv < 0) { - dev_err(&pdev->dev, "Unable to map regions\n"); - goto iomap_err; + dev_err(&pdev->dev, "Unable to request regions\n"); + goto setmask_err; } =20 rv =3D dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); @@ -3834,9 +3836,6 @@ static int mtip_pci_probe(struct pci_dev *pdev, drop_cpu(dd->work[2].cpu_binding); } setmask_err: - pcim_iounmap_regions(pdev, 1 << MTIP_ABAR); - -iomap_err: kfree(dd); pci_set_drvdata(pdev, NULL); return rv; @@ -3910,7 +3909,6 @@ static void mtip_pci_remove(struct pci_dev *pdev) =20 pci_disable_msi(pdev); =20 - pcim_iounmap_regions(pdev, 1 << MTIP_ABAR); pci_set_drvdata(pdev, NULL); =20 put_disk(dd->disk); --=20 2.46.2