From patchwork Mon Sep 2 06:23:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13786757 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 5009A155A2F for ; Mon, 2 Sep 2024 06:24:22 +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=1725258263; cv=none; b=pBbShbHihPJwOQmrg6dyKa8PT72kNx4AKTdNPCObDQecp1XDJ7mAw/ShMK0trPkRyxYyzVAux43ooE9x9RBHhl9aH7lKFu/Gptg4XfU8EBxrWg8MyUYwFOODrUJTDLQjxY2NESGx+lS4mRJKDLZnHrbzn5t9vdHw32oH4z5f2AA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725258263; c=relaxed/simple; bh=zJ+yRIWc0laMt+VA+WcNeC6inAbzeJDFegXsPKCx36w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S+6EzQ9Sv78hkL2QGtNrzmNMqxt627UxJWxEPDB+c9sEcm4YvtLfm38zMKdUkCMacPWjurbc6uSVQCb8iurXlPgOmA7wJR+oTFyIeMJN3yv6AO1GsyycKBcyrChVZ8at7RsB3BPHOZyVwsLNz/Kp7XCvNnev3jiTxJPapad4KPE= 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=F2/ZVVec; 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="F2/ZVVec" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725258261; 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=GT8+L1vpUCD1XCsuz0jWN9YX0IbdjrEGcfF0kmNNelY=; b=F2/ZVVecpW+W2jnEHH48xfsDYdn7eyd/TdHFR9S8RrOIYE1SZXHUM/7K4RWIA2CI/+PJEI Ew0tQ0wRtj4a7Ot8b4kfcQVs+xhHTOiYHL0LnI1ucvqFtqmH5OWEpr6U1gFw5Tx9bhBKg1 smEByYMTGEuz+6W0QBXcySGOJUPG8A0= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-626-5Fd8le2eNV6JSr_fQyRSDw-1; Mon, 02 Sep 2024 02:24:20 -0400 X-MC-Unique: 5Fd8le2eNV6JSr_fQyRSDw-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-7a80e9af094so613493485a.1 for ; Sun, 01 Sep 2024 23:24:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725258260; x=1725863060; 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=GT8+L1vpUCD1XCsuz0jWN9YX0IbdjrEGcfF0kmNNelY=; b=bfUoADA74atxZBcNcaBj20CqCj4fFx+idksHslM4fTIAyfqXgBpF1R+qe7SzQF2x7G pBZH6tRz6Tu6LLbTacA8OldLHgmDYOEao5cs2/TAZhbwBz5jBT9+HXr9tZcfmf0qJosi y6LbUNGFjf+jh2ymfnlLlwvhCH0kQ9nZLQNOtHpSHUqmPwCGCuAxMwqJEjYMqR77FCGa axKHHiAQS1VcGJns2uZGQeKKhhK5ExlRG6TH4PbptiVpWHeNGhrfvLWBzrpK+BRfi/+d cG77OrVl+goyUwFl2diLnKJhC0k7j+XFxJWSfATmLbWtlmvbbA9BbxDTf0Qd/PmxTou3 ll4w== X-Forwarded-Encrypted: i=1; AJvYcCVtI3utFmeM6xmDayMR5n4baKM9CHwVIazzAh4iEMXHtUv0MR/zuz5p8RnZiuOQpUt+gGxXjky8CzyZ@vger.kernel.org X-Gm-Message-State: AOJu0YxkPeq0cIkM/86DJQNP7/XUiKaMg+TwEeXj5oCkXKuUZRf6u9nx Boi60KY/G7AYqntR7wFJ9jEC0DP+BgZqkq3eYE4ewdd4lFYfCOIjjM271vkcKRslYCn9I3zZjAs sbE1Zr5SQjra7QyiXyBtalp/oYHA74cyFf8lc940dplKV7TCC6ZgkVICDZtA= X-Received: by 2002:a05:620a:2496:b0:7a7:d6f2:95f8 with SMTP id af79cd13be357-7a804c2a640mr2635378085a.20.1725258259825; Sun, 01 Sep 2024 23:24:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEcPARd7pINvdoEXA5uo8VzOxTa9IKFSZH5cqNUIddKPjOvMCzbYleHUq9K0UZRMxU4dXhM3A== X-Received: by 2002:a05:620a:2496:b0:7a7:d6f2:95f8 with SMTP id af79cd13be357-7a804c2a640mr2635375185a.20.1725258259468; Sun, 01 Sep 2024 23:24:19 -0700 (PDT) Received: from eisenberg.redhat.com (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a806d3a34asm389211385a.84.2024.09.01.23.24.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Sep 2024 23:24:19 -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 , John Garry , Chaitanya Kulkarni , Philipp Stanner 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 v6 1/5] PCI: Deprecate pcim_iounmap_regions() Date: Mon, 2 Sep 2024 08:23:38 +0200 Message-ID: <20240902062342.10446-3-pstanner@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240902062342.10446-2-pstanner@redhat.com> References: <20240902062342.10446-2-pstanner@redhat.com> Precedence: bulk X-Mailing-List: linux-fpga@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The function pcim_iounmap_regions() is problematic because it uses a bitmask mechanism to release / iounmap multiple BARs at once. It, thus, prevents getting rid of the problematic iomap table mechanism which was deprecated in commit e354bb84a4c1 ("PCI: Deprecate pcim_iomap_table(), pcim_iomap_regions_request_all()"). Make pcim_iounmap_region() public as the successor of pcim_iounmap_regions(). Mark pcim_iomap_regions() as deprecated. Signed-off-by: Philipp Stanner --- drivers/pci/devres.c | 8 ++++++-- include/linux/pci.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c index b97589e99fad..5f6f889249b0 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -771,7 +771,7 @@ EXPORT_SYMBOL(pcim_iomap_region); * Unmap a BAR and release its region manually. Only pass BARs that were * previously mapped by pcim_iomap_region(). */ -static void pcim_iounmap_region(struct pci_dev *pdev, int bar) +void pcim_iounmap_region(struct pci_dev *pdev, int bar) { struct pcim_addr_devres res_searched; @@ -782,6 +782,7 @@ static void pcim_iounmap_region(struct pci_dev *pdev, int bar) devres_release(&pdev->dev, pcim_addr_resource_release, pcim_addr_resources_match, &res_searched); } +EXPORT_SYMBOL(pcim_iounmap_region); /** * pcim_iomap_regions - Request and iomap PCI BARs (DEPRECATED) @@ -1013,11 +1014,14 @@ int pcim_iomap_regions_request_all(struct pci_dev *pdev, int mask, EXPORT_SYMBOL(pcim_iomap_regions_request_all); /** - * pcim_iounmap_regions - Unmap and release PCI BARs + * pcim_iounmap_regions - Unmap and release PCI BARs (DEPRECATED) * @pdev: PCI device to map IO resources for * @mask: Mask of BARs to unmap and release * * Unmap and release regions specified by @mask. + * + * This function is DEPRECATED. Do not use it in new code. + * Use pcim_iounmap_region() instead. */ void pcim_iounmap_regions(struct pci_dev *pdev, int mask) { diff --git a/include/linux/pci.h b/include/linux/pci.h index 01b9f1a351be..9625d8a7b655 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2297,6 +2297,7 @@ void __iomem * const *pcim_iomap_table(struct pci_dev *pdev); int pcim_request_region(struct pci_dev *pdev, int bar, const char *name); void __iomem *pcim_iomap_region(struct pci_dev *pdev, int bar, const char *name); +void pcim_iounmap_region(struct pci_dev *pdev, int bar); int pcim_iomap_regions(struct pci_dev *pdev, int mask, const char *name); int pcim_iomap_regions_request_all(struct pci_dev *pdev, int mask, const char *name); From patchwork Mon Sep 2 06:23:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13786758 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 D5DF017995E for ; Mon, 2 Sep 2024 06:24:25 +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=1725258267; cv=none; b=ld4zRi3myI7rgmY6uhYpb8X2JwtJSMbMcYmbO2nVr1RApT4/pr2v5TMas4/0O4GI28iq4L/YQcS0qMo83mciNhXWgepyiTC+HHOZnMntzogARi8VqCq+2FOzU8kelkUOIE+t4bFPO18eHc8l2VqqhKyoqQo9eLJrY9965CTguEI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725258267; c=relaxed/simple; bh=V4KRcC8BfWc5Sti/Fdc73KUa8QY4uocvnp5UyVnLmQQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gD8yG6buIgdrStWJNRGH8n8M8nedgNzQZSNVsFtjOfRAPFJBAYpD7qh+yQI9Ym1zngmqe8cZFAd+8L7iv8LQ3cnralii8qroLEBPmmpxlkibzGg3to7YuLRBrXsBo4h1MkHf9iBePm5ya1x8PU6ZSkuUIzos588z3AHEy3XZuUs= 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=dCCpQ16Q; 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="dCCpQ16Q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725258265; 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=j5hLs33+KllKyvrdGIaXp9UPbFVf3GpM3GrIwQsqtHc=; b=dCCpQ16QFzI4MW5iO/8umxomU81/VJRGdsL9yshjxr+F/+t305uMUJFRhRJ33TRCWB/sZS fF6n6RVIc9+ivsAuLEn273B2EnFqZPX7177bzCQdieDV43lmr+DcvkwhJL6E8CdseqZKv3 gqwNfVmO2avGh3S8uJ/ITYNdx+2fxjw= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-298-NC0ZZeKxPEaq7CNsNUn9Lg-1; Mon, 02 Sep 2024 02:24:23 -0400 X-MC-Unique: NC0ZZeKxPEaq7CNsNUn9Lg-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-7a968ad3765so145975985a.2 for ; Sun, 01 Sep 2024 23:24:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725258263; x=1725863063; 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=j5hLs33+KllKyvrdGIaXp9UPbFVf3GpM3GrIwQsqtHc=; b=gdTwT8sEAXmSQLuoOBySs79pl7DPXeg3UdO3xwBLNHycepe8BIkz/rriVAsnkX89o3 lU8Dn/qadvU56qGYFGqIFx5JTwzAHJv5t3mvD+gG2dq2Gx3Z2U4qNyf3sbZVYyuO0PKu Mu//Gxn7Ahf48AArqMcDhtApF/xwg4KKV/DkBabAAhyTgOcqpxmFAapz4JnHzNIzthYK OnqF3Ye/PPguT9B6YGTl6jiT2/CT5zzs0RKj/tYGhYlhfmcUYTu9LPbI+Vw9esIHWM9o 4rq72rGCSSVyXie1honAByLzW8YQgRmJERbvSerTdtZl9rAmxywVBWolyfZ5QL7mTVQd fs1Q== X-Forwarded-Encrypted: i=1; AJvYcCVM9o7JwGcS/ucu79lFgWS/PeEr2pOzYHLGtvrkL2X2T5coQA+lgOKY60840qdqg+4WRyZn+RjtlXj4@vger.kernel.org X-Gm-Message-State: AOJu0Yx2GY+cBYzUnq4+lE1ZTcYIrpsHB1BLWvGCZbAIOTkXjtNNoGaM 1QZn7rFp9s1FiGKctrG7KPNTr3NdEaHTcHaOWhN10ScWXjNC0ZO3TYWWBUW9yczZDshqzhd4pGr veZ6W7epfmNcTs/0SNYskvO7q6Fs6x3qQ7EGPqEwhi5chVcx0sk5LrwK70M0= X-Received: by 2002:a05:620a:430b:b0:7a6:5c8e:10fe with SMTP id af79cd13be357-7a804266c1bmr1694476885a.53.1725258263144; Sun, 01 Sep 2024 23:24:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPpfy2AwzBVBvCGLt6NdOfcVUX9tS8CXYBUh8z9oXo7696XQ8Ic8gWj62Bu7ymXSEARN/JRQ== X-Received: by 2002:a05:620a:430b:b0:7a6:5c8e:10fe with SMTP id af79cd13be357-7a804266c1bmr1694473785a.53.1725258262782; Sun, 01 Sep 2024 23:24:22 -0700 (PDT) Received: from eisenberg.redhat.com (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a806d3a34asm389211385a.84.2024.09.01.23.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Sep 2024 23:24:22 -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 , John Garry , Chaitanya Kulkarni , Philipp Stanner 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 v6 2/5] fpga/dfl-pci.c: Replace deprecated PCI functions Date: Mon, 2 Sep 2024 08:23:39 +0200 Message-ID: <20240902062342.10446-4-pstanner@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240902062342.10446-2-pstanner@redhat.com> References: <20240902062342.10446-2-pstanner@redhat.com> Precedence: bulk X-Mailing-List: linux-fpga@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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()"). Port dfl-pci.c to the successor, pcim_iomap_region(). Consistently, replace pcim_iounmap_regions() with pcim_iounmap_region(). Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko Acked-by: Xu Yilun --- drivers/fpga/dfl-pci.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/fpga/dfl-pci.c b/drivers/fpga/dfl-pci.c index 80cac3a5f976..602807d6afcc 100644 --- a/drivers/fpga/dfl-pci.c +++ b/drivers/fpga/dfl-pci.c @@ -39,14 +39,6 @@ struct cci_drvdata { struct dfl_fpga_cdev *cdev; /* container device */ }; -static void __iomem *cci_pci_ioremap_bar0(struct pci_dev *pcidev) -{ - if (pcim_iomap_regions(pcidev, BIT(0), DRV_NAME)) - return NULL; - - return pcim_iomap_table(pcidev)[0]; -} - static int cci_pci_alloc_irq(struct pci_dev *pcidev) { int ret, nvec = pci_msix_vec_count(pcidev); @@ -235,9 +227,9 @@ static int find_dfls_by_default(struct pci_dev *pcidev, u64 v; /* start to find Device Feature List from Bar 0 */ - base = cci_pci_ioremap_bar0(pcidev); - if (!base) - return -ENOMEM; + base = pcim_iomap_region(pcidev, 0, DRV_NAME); + if (IS_ERR(base)) + return PTR_ERR(base); /* * PF device has FME and Ports/AFUs, and VF device only has one @@ -296,7 +288,7 @@ static int find_dfls_by_default(struct pci_dev *pcidev, } /* release I/O mappings for next step enumeration */ - pcim_iounmap_regions(pcidev, BIT(0)); + pcim_iounmap_region(pcidev, 0); return ret; } From patchwork Mon Sep 2 06:23:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13786759 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 C0C0718130D for ; Mon, 2 Sep 2024 06:24:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725258270; cv=none; b=JXXMGEBp2PyAse8rxhvNw6MNokdlsr2EO6HBF4NuPx6cTyay4oJrHg3oIMgJhc/QGgPTpf6kiQmy/MDcUYfmVksGmwyntiDmaqMke8rrbyMXn6f+DO29MDtf9Jg9HQSWeU562rc7Zd3ebeGxJCziKISe+Mc/L5B9fuoo6OMjGtQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725258270; c=relaxed/simple; bh=s4GctkYHbXn3tfM8TOsiQdy7M4dRLmQpFi1urTUZZ7M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pCVX14FwUusDndvJEbWOasZ7bHixGju5K2NTRBC0tLsqLzX1nhi9WuzU3VEBwyTn2PqP/jTTJK7OyAN4EsyXktu5x8od4gXSQ3aKx7xEiCwcsecMkSqGjDDoQPa7wRa+eIeN7E8l1QMQ0G0HK0oyG4yEz9c2H7qShxcrftlrNkc= 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=QqWd9xq9; arc=none smtp.client-ip=170.10.129.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="QqWd9xq9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725258268; 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=YtYR/gGTmDbAPYmIYRccbXqwblJKOZwAhQg2Y6pwqmg=; b=QqWd9xq91hkO/Jy+Xfi/7nYQX2iR2QqNOq728m+SZPl5T+I0qLJOpZm2Kybu1FOWElJeSY 1vUdA5Tj/EPy+6EXkpsuMmLrGXE5BnQP7kxJukJfGeY0LZvkYTO4OE9McTqtozJxN4N1l1 jm6kYj3xyhzUJqnPwdgAvH7EgCLmR84= Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-621-3zOoeXqZNZS_UFoFYQzntg-1; Mon, 02 Sep 2024 02:24:27 -0400 X-MC-Unique: 3zOoeXqZNZS_UFoFYQzntg-1 Received: by mail-vs1-f71.google.com with SMTP id ada2fe7eead31-498f35d9827so1452140137.1 for ; Sun, 01 Sep 2024 23:24:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725258266; x=1725863066; 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=YtYR/gGTmDbAPYmIYRccbXqwblJKOZwAhQg2Y6pwqmg=; b=Qlh9G38dSpOx+KXkus0MMEPTsNk6oFttDDd+fH3e70CY7QhpdaJ2hv1/vR2TDQH39Y jqdTcgLKOWZydjVs9o7p8tT+2Yxugbg1gRWQskNaLBqf/wq90n/Qj4I84T41+WxpypZP BJ2/eDks27SWuRltIUxCX4Al/8x5JBcDztlF6uHHtVaaYeBHgpsmwkwY6GwaoGbPD81w cNFPJBtOies6Fuib8++k42qZdr100fEZpXSkGAhLh0q88cL2wdg5rSHNGH4GNRGqGsZJ F/Gvyl4+YScUmBJjOWX0G+DWxkya2/WhpC8Hu6M1njidi77bunwwlAar5pWODcO5Eh9u tiAw== X-Forwarded-Encrypted: i=1; AJvYcCX+giLT7Y2/aZIV25zc7h7L1TYBk1dy1KhQo0SQHYjK/gkKskJNx4BfB7uLz047l25UVfMyLr58w5dh@vger.kernel.org X-Gm-Message-State: AOJu0YweoeqtiVw2s9/typwV5w/lqIt6waGRXSgB9Iz9M0ERttwj2Gb2 gAsP/ibvdDENcNmE4hROYrBMr/g6zvBGFne1EvpuDIfyv41dKtRmxNFFkQgBw6opQk5c/n84bmI s1qpQftivTBrNFGXcLzgN976c3JS3FEKGDKrTc/m6Aca6OM9iLOhan3As5tg= X-Received: by 2002:a05:6102:32ca:b0:492:aaae:835d with SMTP id ada2fe7eead31-49a77511b65mr8535888137.0.1725258266456; Sun, 01 Sep 2024 23:24:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFluumio3mIduLZuNyfcu74sOvja3KJmTiLmPPfUiTP6sb83KtvxfvnRpv/SNgep1ECH+mcbA== X-Received: by 2002:a05:6102:32ca:b0:492:aaae:835d with SMTP id ada2fe7eead31-49a77511b65mr8535871137.0.1725258266122; Sun, 01 Sep 2024 23:24:26 -0700 (PDT) Received: from eisenberg.redhat.com (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a806d3a34asm389211385a.84.2024.09.01.23.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Sep 2024 23:24:25 -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 , John Garry , Chaitanya Kulkarni , Philipp Stanner 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 v6 3/5] block: mtip32xx: Replace deprecated PCI functions Date: Mon, 2 Sep 2024 08:23:40 +0200 Message-ID: <20240902062342.10446-5-pstanner@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240902062342.10446-2-pstanner@redhat.com> References: <20240902062342.10446-2-pstanner@redhat.com> Precedence: bulk X-Mailing-List: linux-fpga@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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/mtip32xx.c index c6ef0546ffc9..e4331b065a5e 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -2716,7 +2716,9 @@ static int mtip_hw_init(struct driver_data *dd) int rv; unsigned long timeout, timetaken; - dd->mmio = pcim_iomap_table(dd->pdev)[MTIP_ABAR]; + dd->mmio = pcim_iomap(dd->pdev, MTIP_ABAR, 0); + if (!dd->mmio) + return -ENOMEM; mtip_detect_product(dd); if (dd->product_type == MTIP_PRODUCT_UNKNOWN) { @@ -3722,14 +3724,14 @@ static int mtip_pci_probe(struct pci_dev *pdev, rv = pcim_enable_device(pdev); if (rv < 0) { dev_err(&pdev->dev, "Unable to enable device\n"); - goto iomap_err; + goto setmask_err; } - /* Map BAR5 to memory. */ - rv = pcim_iomap_regions(pdev, 1 << MTIP_ABAR, MTIP_DRV_NAME); + /* Request BAR5. */ + rv = 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; } rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); @@ -3849,9 +3851,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; @@ -3925,7 +3924,6 @@ static void mtip_pci_remove(struct pci_dev *pdev) pci_disable_msi(pdev); - pcim_iounmap_regions(pdev, 1 << MTIP_ABAR); pci_set_drvdata(pdev, NULL); put_disk(dd->disk); From patchwork Mon Sep 2 06:23:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13786760 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 717B0185B7C for ; Mon, 2 Sep 2024 06:24:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725258275; cv=none; b=XPM7xKd/e+OZlfS0y64lT5GxWEiXe+dJNZZdHTP0w6H2U+w+sOVJ4NGM4G5BogmSvR+EiUKdz5xF9gyGAV6JhRQ5Zz/VjDBhW0vfLqHCnm6oFKDJ+bhqUnQBfOk0XoFP218IBhcQ+kcuIBlEyTCtibsA5mXkFswt7CU0UTiNaPk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725258275; c=relaxed/simple; bh=Fc7LqA4dsnee2e9i3xlXjC/frSEy4rrwVedoLFfxfmw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ILShz732M7oMiu1cqvHJcR2JiXVQQ5I1w5gYxIrFl6nLIprd73DFR1K5rRaEoVqHZQogVdYc1E9EmsJI7OrwShflYUsQ3TP07Wgw9dGQFL/7LNVZ5RyvkCKO/FHeFvfPw2raFTKAOzl3OOZFL6UjJdhIw+amIutqovlneU0sYrM= 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=PyGh2hFJ; arc=none smtp.client-ip=170.10.129.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="PyGh2hFJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725258273; 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=/H9qQSvRoJEHuC9fzeIRZ7nyD5NIc+bT7koxtRIZd8A=; b=PyGh2hFJpfpz1Sw4GHa51hGHDN45XnH+ik+G75Zb1+vzu6f0Nrf54GQ7Zuj6oXEc9zQY3D NECcYpxULp+O/f2//V1O8QyUOZYmQWdSB89zy7vSthUXnGvbakKpuROZreTLD6Tz6BacpO ys4dN4Kdug+coauluAk2I3StA6GbtNI= Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-623-5HUz8wIyNr2zkFO-XLPBEA-1; Mon, 02 Sep 2024 02:24:30 -0400 X-MC-Unique: 5HUz8wIyNr2zkFO-XLPBEA-1 Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-846c51fb226so399205241.1 for ; Sun, 01 Sep 2024 23:24:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725258270; x=1725863070; 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=/H9qQSvRoJEHuC9fzeIRZ7nyD5NIc+bT7koxtRIZd8A=; b=iMtwehzVa5qzo0tyzUXbEdFkr3pHY6V8qAh5eidY9OT4tcFHXmcVnHSsuduR+ZtboP 4+HM3g1eTyBbewrvKABftZu8hHIZmJ4kxPPA4jspZMjFLbhNoNMB3m6YKfCGNs8uGYUq qzBjDiD5bKsWsVCRERYd0HAnGGcO+SSIMHKUoI4dJQyd86km/rn8XBS06CPOIx15q+eI Wj59uct2lgEjjFeIsSIePENOHjWDbsNhgeDW45yYGvHDykQROh60OAhO1U9Z+0RDSyod qVbTWTU6D6UkLrpo2sABe1PoXHGZwl/y6AmdOQE0z5iaDzJ3oxpox8aeIYeZGIjUg5fI OKHQ== X-Forwarded-Encrypted: i=1; AJvYcCWWyzau+3VcQnH2XGWrMIdHVGhlOM+0UtmA78f7sGL/YguMQkIGNYrgZngzbDVkNIDT/QiEF1FxUgIf@vger.kernel.org X-Gm-Message-State: AOJu0YzFclTExpfTTLfG/9lR0Yy7ivTiAF4y5FGiKfSZedX+Cnz8e5yz e2MUF1+3tVQj65hNEdGilc1Q+qSRh+GhLvhSkDC+VFL7I3G+L9kDcpBctisjeCK46QHktHzlxox /pD9CJLwLVU5XFLNyhvdgNE2UBwa5tgoMAcqIe9Wijrw22gGgWIOAzB7pALc= X-Received: by 2002:a05:6102:3e89:b0:498:ede5:b20f with SMTP id ada2fe7eead31-49a779a41c8mr7270553137.19.1725258269933; Sun, 01 Sep 2024 23:24:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHvKk7L/2Q+f5ePTEDKBoGd9wpJAI1J/cRLRuOI8ztSXLRi4Uiggu4Svtva7Pn5OPFtOZyMyA== X-Received: by 2002:a05:6102:3e89:b0:498:ede5:b20f with SMTP id ada2fe7eead31-49a779a41c8mr7270533137.19.1725258269592; Sun, 01 Sep 2024 23:24:29 -0700 (PDT) Received: from eisenberg.redhat.com (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a806d3a34asm389211385a.84.2024.09.01.23.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Sep 2024 23:24:29 -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 , John Garry , Chaitanya Kulkarni , Philipp Stanner 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, Bartosz Golaszewski Subject: [PATCH v6 4/5] gpio: Replace deprecated PCI functions Date: Mon, 2 Sep 2024 08:23:41 +0200 Message-ID: <20240902062342.10446-6-pstanner@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240902062342.10446-2-pstanner@redhat.com> References: <20240902062342.10446-2-pstanner@redhat.com> Precedence: bulk X-Mailing-List: linux-fpga@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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()"). Replace those functions with calls to pcim_iomap_region(). Signed-off-by: Philipp Stanner Reviewed-by: Andy Shevchenko Acked-by: Bartosz Golaszewski --- drivers/gpio/gpio-merrifield.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpio/gpio-merrifield.c b/drivers/gpio/gpio-merrifield.c index 421d7e3a6c66..274afcba31e6 100644 --- a/drivers/gpio/gpio-merrifield.c +++ b/drivers/gpio/gpio-merrifield.c @@ -78,24 +78,24 @@ static int mrfld_gpio_probe(struct pci_dev *pdev, const struct pci_device_id *id if (retval) return retval; - retval = pcim_iomap_regions(pdev, BIT(1) | BIT(0), pci_name(pdev)); - if (retval) - return dev_err_probe(dev, retval, "I/O memory mapping error\n"); - - base = pcim_iomap_table(pdev)[1]; + base = pcim_iomap_region(pdev, 1, pci_name(pdev)); + if (IS_ERR(base)) + return dev_err_probe(dev, PTR_ERR(base), "I/O memory mapping error\n"); irq_base = readl(base + 0 * sizeof(u32)); gpio_base = readl(base + 1 * sizeof(u32)); /* Release the IO mapping, since we already get the info from BAR1 */ - pcim_iounmap_regions(pdev, BIT(1)); + pcim_iounmap_region(pdev, 1); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; priv->dev = dev; - priv->reg_base = pcim_iomap_table(pdev)[0]; + priv->reg_base = pcim_iomap_region(pdev, 0, pci_name(pdev)); + if (IS_ERR(priv->reg_base)) + return dev_err_probe(dev, PTR_ERR(base), "I/O memory mapping error\n"); priv->pin_info.pin_ranges = mrfld_gpio_ranges; priv->pin_info.nranges = ARRAY_SIZE(mrfld_gpio_ranges); From patchwork Mon Sep 2 06:23:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13786761 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 7C6D71865F6 for ; Mon, 2 Sep 2024 06:24:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725258277; cv=none; b=C+mp2rdHaf+C7w/9AdTWomCtWiNn2Pla6KslXKxAeZYLI82+ITuJNqHqaFqecqvhr1DJoE/sXIhFauqvePE97aZj7pg0izmxNKo6au5KcL6OXbiqYgw16dj79jgwQ5QHpTibwlheYnqXOtpi9uxGqeMF9OsF6OwPh3eSN+7HUEQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725258277; c=relaxed/simple; bh=nzy04PgDjxRp4clOpzx7ZwAQtwC8BOnrH0UdBVVoGHw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RNBPOAVz143NzO/0QbYJnfz4LztVmkXOGnWnEE4L32Ah9RJuFy3NJJBeHKJTKUqYdEkxscACycBN3cfKRA2z48nGWgYI9DachXYWhOsuYtcsPZi0nPhi9tY54lOoC/Spo8JGKQN1EOGHAt7WQtLpXPZjcoGMtlhzVYgVlieZwb4= 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=DAg5CVsu; arc=none smtp.client-ip=170.10.129.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="DAg5CVsu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725258274; 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=osuRWDMAcWp5GKuvb2jQp7XxiFBFhqIKDkkqm4u4oTc=; b=DAg5CVsumCopzMeZnK3RuP4UIb67NO61OIFEVdn//bPvHvujNHwwFafb3ZqMNsYxKVtQON AravmhVKHR9JYENpEZBzycGsFAZ6SKhly7DthcGmFsN6MyV2Ia3d5otK5gWtT6FwynX9fE xOByABYfFRrCV8iypqY6r57kWI6Kttg= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-117-1O9LjTc8OvexWluHRCb0Qg-1; Mon, 02 Sep 2024 02:24:33 -0400 X-MC-Unique: 1O9LjTc8OvexWluHRCb0Qg-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-7a80872dab0so728440285a.1 for ; Sun, 01 Sep 2024 23:24:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725258273; x=1725863073; 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=osuRWDMAcWp5GKuvb2jQp7XxiFBFhqIKDkkqm4u4oTc=; b=TKRJlbhE1LI7sASm3C/Z/8yOrV31U4wYxFV5ZRYxJqU208B4sl6kd5im0+WbPypVVL gvUaepFPMF/7n5uNXbOwehRfuv5yDntAyivb/hcPjPDr8WpKyHISO60NbzJbnDiecnDo gbVTbkIwXuGCvp6ZcgqjE6lFIOsN5cxFSRCZadsyfOZdheiJXZTekwyYV36/FJMiIcv7 0ivEtuweF9cMNJUsgFIwCQFq1QYIYORLGv9Rx+rYXASZKrpCynS3GkVE+zlhT64mj16e XsLV6ZAh2N8vC3A8ogvFktAaouhz+yI3DAEL6whfKwcaEzYd17ZYbKpdLOA3wocKW2sl SOyg== X-Forwarded-Encrypted: i=1; AJvYcCWrM3uNsxVRFqjelI8hChhER+ra41nwOj0ecvT0K97kz/8KQpRM1kblHPAwehNnQko+g2i13WkO94ts@vger.kernel.org X-Gm-Message-State: AOJu0YzU11rSVZ/w8fa+yesjwMK4S8SR4R27bKHmLEaRsHzS0ME1G+k0 KC68ba0bFlsPhKnT8eeBGz4IXt/sMQ69tePOTRRc9QWP37pQcI2J7YrhTJioLQG9vKZeVct5Nt0 C7EJk8AVtrFeS/TiVWQPifrARyVJq4a3nXOlvP6n9wYN6pv2o3ZzxyoDCYxA= X-Received: by 2002:a05:620a:3951:b0:79e:f9f4:3e99 with SMTP id af79cd13be357-7a811ecfe8emr1725900985a.1.1725258273273; Sun, 01 Sep 2024 23:24:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEexv0y+qPfnTJJBqxCFNiKb4Lgt4+HkyzFHyOqMwr6MWuDLpzTLWaUJJYagADLPPfibqpGLg== X-Received: by 2002:a05:620a:3951:b0:79e:f9f4:3e99 with SMTP id af79cd13be357-7a811ecfe8emr1725898585a.1.1725258272892; Sun, 01 Sep 2024 23:24:32 -0700 (PDT) Received: from eisenberg.redhat.com (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a806d3a34asm389211385a.84.2024.09.01.23.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Sep 2024 23:24:32 -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 , John Garry , Chaitanya Kulkarni , Philipp Stanner 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 v6 5/5] ethernet: cavium: Replace deprecated PCI functions Date: Mon, 2 Sep 2024 08:23:42 +0200 Message-ID: <20240902062342.10446-7-pstanner@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240902062342.10446-2-pstanner@redhat.com> References: <20240902062342.10446-2-pstanner@redhat.com> Precedence: bulk X-Mailing-List: linux-fpga@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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()"). Furthermore, the driver contains an unneeded call to pcim_iounmap_regions() in its probe() function's error unwind path. Replace the deprecated PCI functions with pcim_iomap_region(). Remove the unnecessary call to pcim_iounmap_regions(). Signed-off-by: Philipp Stanner Acked-by: Paolo Abeni --- drivers/net/ethernet/cavium/common/cavium_ptp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cavium/common/cavium_ptp.c b/drivers/net/ethernet/cavium/common/cavium_ptp.c index 9fd717b9cf69..984f0dd7b62e 100644 --- a/drivers/net/ethernet/cavium/common/cavium_ptp.c +++ b/drivers/net/ethernet/cavium/common/cavium_ptp.c @@ -239,12 +239,11 @@ static int cavium_ptp_probe(struct pci_dev *pdev, if (err) goto error_free; - err = pcim_iomap_regions(pdev, 1 << PCI_PTP_BAR_NO, pci_name(pdev)); + clock->reg_base = pcim_iomap_region(pdev, PCI_PTP_BAR_NO, pci_name(pdev)); + err = PTR_ERR_OR_ZERO(clock->reg_base); if (err) goto error_free; - clock->reg_base = pcim_iomap_table(pdev)[PCI_PTP_BAR_NO]; - spin_lock_init(&clock->spin_lock); cc = &clock->cycle_counter; @@ -292,7 +291,7 @@ static int cavium_ptp_probe(struct pci_dev *pdev, clock_cfg = readq(clock->reg_base + PTP_CLOCK_CFG); clock_cfg &= ~PTP_CLOCK_CFG_PTP_EN; writeq(clock_cfg, clock->reg_base + PTP_CLOCK_CFG); - pcim_iounmap_regions(pdev, 1 << PCI_PTP_BAR_NO); + pcim_iounmap_region(pdev, PCI_PTP_BAR_NO); error_free: devm_kfree(dev, clock);