From nobody Wed Nov 27 02:40:25 2024 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 E79AC150980 for ; Mon, 14 Oct 2024 07:53:41 +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=1728892423; cv=none; b=ZNeTiBPJAqgSA1r28Xj3p/q79/Kb2Nl+c7GQjkycrUvQAuvrofsXjzi+yua/FL+rj+baO7cQQ2Ez04gaTxzwKjlP84NfCaQXQG1wF04WMm3CII3lO/riSkKk3W+nxMWjhUmwxnzFi/Yn6Dz0TYEO4xSKNEtkHKiPPIb6BaiUh4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728892423; c=relaxed/simple; bh=veogpasXu8DFoes2pWWrRajzT/Tb+yGbiuMWIlqIVQU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HythEZVRREERw0dhmG29/+AcBoiHpItdDvMoRrRJbjiA7ibFGNJO16L9jYR+d/gPmyUzDaS0AmztAzrM/wfRSJRJT82JCQIZWL+KYTNfr0SSY/ob26XUHgyZ16l2xoOSQRipeDWFPTu0/+6N5D3peDpo0RYq9PE7/zPp8oOVNBM= 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=PEADhPiz; 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="PEADhPiz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728892421; 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=r7W6/l7rxCsNe9vQIzzAVccxaNC6ce1XTcoL6qo42AA=; b=PEADhPiz1rCv3pMryE51hS3/PliSPIX107V03XV8xYI+vxwoqUkTWaYT8deAfFNB4LibMy bZKEPdqmjAUdbCKuSmqfVZ/pGtgvImPEjJR9vH0JfhU/OZpP2tWU69/cFjIfXzTEvtSTcv BqE9eOTpqTR2kosdSaNNpUFceDYZYdE= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-151-YR5cWGu4PpqcDumtFGb9Bg-1; Mon, 14 Oct 2024 03:53:37 -0400 X-MC-Unique: YR5cWGu4PpqcDumtFGb9Bg-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a9a0d8baa2cso56053266b.0 for ; Mon, 14 Oct 2024 00:53:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728892416; x=1729497216; 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=r7W6/l7rxCsNe9vQIzzAVccxaNC6ce1XTcoL6qo42AA=; b=BrVGRFQyzRQOnTYC84xvSAfvtUnbpTjVAn5j2k8/+GthipABykxK+9NbxXBrIcIU9J R/exthZt24T4CTNa/atnlOzG2LFaHza2W6h2uvpz8gsgXk8pw3kgVGXdGjGHMI+icEMS /c65NIN9Ef4d0ybAkaYz2tYsaF6IsTeFy1rpK3fyB9eZlApPA2fsGL5rwxjW+CZfsDle 0RkM1bWrPOpxSv+xf73HnjI2q3yaYOaulMFoBql9lNe43tfVIoJ2POTPQH7k4o//lxBV Hp6D2FzhRtw/AEojIg8RS5Cc6+yiSyu6pqqZnWB0YvjeLjgZtFUS7yPKl8O/03DTxIWs voHQ== X-Forwarded-Encrypted: i=1; AJvYcCUnOGxiXAu/wazXBEGROV31yv02mN7R+daclvdZlrCbtH/DFwtPCcOJWQ7GxEToaM9pdxgcxZ5eCkiGL/I=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+H6C7rptFTZezdZOphp8tPV6Av0YQALO0OB7W/0TIAN/WBRUH LRzFqkW4MkeZD73GBUVhjdxscDfT/7X31vo/JPTseSXv52G9sn+mCGtq5e7/avoLk7ST57At+gx OE9olDDrBpnBcOhW42RNf8GV4ARI7sbVPMJkVR8svEunhAAF2iM66uiyZXa706g== X-Received: by 2002:a17:907:7ba9:b0:a99:4c71:704 with SMTP id a640c23a62f3a-a99b899df18mr956653566b.26.1728892416373; Mon, 14 Oct 2024 00:53:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGcdlsL1TfE08opAxaZFL/GkS8KN4PCrsMz97DjWs5H+hxx58tt0LTAJvoIs9ET3WVAzpRpJg== X-Received: by 2002:a17:907:7ba9:b0:a99:4c71:704 with SMTP id a640c23a62f3a-a99b899df18mr956650866b.26.1728892415932; Mon, 14 Oct 2024 00:53:35 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 00:53:35 -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 1/5] PCI: Deprecate pcim_iounmap_regions() Date: Mon, 14 Oct 2024 09:53:22 +0200 Message-ID: <20241014075329.10400-2-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" 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 b133967faef8..a486bce18e0d 100644 --- a/drivers/pci/devres.c +++ b/drivers/pci/devres.c @@ -773,7 +773,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; =20 @@ -784,6 +784,7 @@ static void pcim_iounmap_region(struct pci_dev *pdev, i= nt bar) devres_release(&pdev->dev, pcim_addr_resource_release, pcim_addr_resources_match, &res_searched); } +EXPORT_SYMBOL(pcim_iounmap_region); =20 /** * pcim_iomap_regions - Request and iomap PCI BARs (DEPRECATED) @@ -1015,11 +1016,14 @@ int pcim_iomap_regions_request_all(struct pci_dev *= pdev, int mask, EXPORT_SYMBOL(pcim_iomap_regions_request_all); =20 /** - * 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 573b4c4c2be6..c4221aca20f9 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2296,6 +2296,7 @@ static inline void pci_fixup_device(enum pci_fixup_pa= ss pass, void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxl= en); void __iomem *pcim_iomap_region(struct pci_dev *pdev, int bar, const char *name); +void pcim_iounmap_region(struct pci_dev *pdev, int bar); void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); void __iomem * const *pcim_iomap_table(struct pci_dev *pdev); int pcim_request_region(struct pci_dev *pdev, int bar, const char *name); --=20 2.46.2 From nobody Wed Nov 27 02:40:25 2024 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 AD78514F126 for ; Mon, 14 Oct 2024 07:53:41 +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=1728892423; cv=none; b=OqYWRy/OuFVoYskZp0wx0UxlieXzFJKmMA1AIhZg0iwu9KyCm5dugRAsBNE/gzkXYYdqP8+qnKh5fgi9ciugVYcwQSx0+LGxX+IEtvodhvBsfV+VQBkY0uCWez7Mc5sKcNjo29ozAA5flG/EOZAG/jQio71rDs8IrArQ9tOxR1E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728892423; c=relaxed/simple; bh=20dHbTNM+hZemZeemkf/zrLwaqYqHauu10+I7bKd7Tg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pD2C+ldPltW8w+a+f6Njm27M2sYyKKfoiYFRetwXTBhZPYV/00eRB8er/eVMCnJIE8rZtE3J/G4IhKhg2sCSh2ZPoGnTPai5Ujh0w5KTUxesmUfqGKP/WOGPtWAkbth0V2CHWBKJBPohysTMdDGqTTqJ4hkYLWyOXMncVoxJJ+4= 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=OZThmX5+; 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="OZThmX5+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728892420; 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=tTleeIx32xfGthGbrYB2jpEkGH+phvUDXuHiflf4emI=; b=OZThmX5+f/zL5vbQuhtXouxFpFMlueEfNz8NVmwri6dV/93emXrF3JTrIkyibzfj76x1ez wz/HWV+CfFMIv1k8KJta5anE9+yRiJX6r5Hr2n02gOuw+hNx7uY7dKTA4gGD7lndY97fob 49XTDo1lkfLDQS6zM8KgKo8LSd0DgyU= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-187-q0ywpUueOMOuoWpi4s315w-1; Mon, 14 Oct 2024 03:53:39 -0400 X-MC-Unique: q0ywpUueOMOuoWpi4s315w-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a99f084683fso121901566b.3 for ; Mon, 14 Oct 2024 00:53:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728892418; x=1729497218; 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=tTleeIx32xfGthGbrYB2jpEkGH+phvUDXuHiflf4emI=; b=ZcEGfWpA1Fjsv7hhYYt8jtQmRdZta7JbOI3AAusZQh4wXLscIHvAg5jj96lDOFq0UP JfXUSFgwdpcIH6rkOTKO4/9VLHRdZHvropOz2pyc1qTrnnn/0veK4/fPYFh8kRD8zh+l 73FFwByblkEXvDcThhzLD+Cv1UQ9RQj5MsgI59hykeWXw09MRxcnID+PoOZhLokTQMS/ w5fsHjo0Ca8JZlinUqxbkiN5kjFhHum1ui1qJplWOvnaHqtDuiGv/z/6dRufTsbwsZOQ uCkjFMILzfbSO8+y2BlPgopPtGtM9nA0H2myMOSEad5FMswi6bCwX5TB8oARhiUKn5qh c60w== X-Forwarded-Encrypted: i=1; AJvYcCXmjDnZU6eEAypy2GRbtBBqudkHI+oXp+EQWaIHs+6the0BYhKKZKp8PlYh4BtMS99MKzyTK6y61gO8dmA=@vger.kernel.org X-Gm-Message-State: AOJu0Yz3OF+2gJS42Ck4R4JH4QSDEUul3uekna5hzImCFrdCcXtz8bxf iYy09UawcsuE3B2QfDZv3v9+TnJoxicPZmtC2isz659KF5Qz7ecemeQD9M4nCIXJglEwr8RYxs4 bcKN4uPeQoIrCE71alKiK0FrCL8YpA/XggEb1SiJH+8xwkOpl0Uh69SAh/GsCfA== X-Received: by 2002:a17:906:478b:b0:a99:fc9a:5363 with SMTP id a640c23a62f3a-a99fc9a60a2mr368733266b.9.1728892418067; Mon, 14 Oct 2024 00:53:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUnosY+kibFUuBIFRq/gqj6RpYmUBSd6Q1TUjFGYFrABqsddiCupMgUWAcTJEMJoMK0CGTFw== X-Received: by 2002:a17:906:478b:b0:a99:fc9a:5363 with SMTP id a640c23a62f3a-a99fc9a60a2mr368729166b.9.1728892417590; Mon, 14 Oct 2024 00:53:37 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 00:53:37 -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 2/5] fpga/dfl-pci.c: Replace deprecated PCI functions Date: Mon, 14 Oct 2024 09:53:23 +0200 Message-ID: <20241014075329.10400-3-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()"). 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 */ }; =20 -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 =3D pci_msix_vec_count(pcidev); @@ -235,9 +227,9 @@ static int find_dfls_by_default(struct pci_dev *pcidev, u64 v; =20 /* start to find Device Feature List from Bar 0 */ - base =3D cci_pci_ioremap_bar0(pcidev); - if (!base) - return -ENOMEM; + base =3D pcim_iomap_region(pcidev, 0, DRV_NAME); + if (IS_ERR(base)) + return PTR_ERR(base); =20 /* * 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, } =20 /* release I/O mappings for next step enumeration */ - pcim_iounmap_regions(pcidev, BIT(0)); + pcim_iounmap_region(pcidev, 0); =20 return ret; } --=20 2.46.2 From nobody Wed Nov 27 02:40:25 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 From nobody Wed Nov 27 02:40:25 2024 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 6EC981553AF for ; Mon, 14 Oct 2024 07:53:44 +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=1728892427; cv=none; b=D1d+sUjTXzqzuD850FADCLPv9+fMYTzphch68VaJ+91b4bTUlEVdsD/pCRaZx26A6Bii4mjs+cyYhnUJt8bnSeFdCbpsB9xtnX0Gt8xYAW5Hi3iZ+WcaAIIyEwpSOVYQerGa6uTvHm5yaDPBJUqtSlgLJ8lRC2ku3VIPARpF9E0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728892427; c=relaxed/simple; bh=yzjQRsYbPqQgU1+oVL1O83MZ0bHUaj1hK69Y+ToXG5M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cfq0oXSdIY30Fwkb5wUNbDRV2wMOdj5My/F/2Zi+LmvnZBnnY/WhtgVWuCKfksS0qwUdkyc2/+J2BoEoVGL36//7x6J/wYDZ99vUOtprVyUFdIAN/G0HBYkfEO1Sjw6hhMTv9Qf17eActI8JsXVq876LJZat3gOADNNqNVQtmWI= 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=Nr7H/Cvw; 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="Nr7H/Cvw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728892423; 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=XpYBp0Glw6qhc5uIPnL78eLKbUhbnbbx8B94lLKnhns=; b=Nr7H/CvwrrXgdme6+Iw8Ztz929vVjOkg83vRNLR3v/RP4hnPX8rsA1J+dNjX8Cm+z2b82F VQApmIlWBZl5pTXVxNuNKbUjVYlr7H7YwZMQqxPiSJ+24xnLsPAYTEFe2VrYLPF0yxOZ3Z MHCgReNh9koSPN+FwLI9N6Q3MfBDCyM= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-133-ycw1WK9nML6u1zJoe_05TA-1; Mon, 14 Oct 2024 03:53:42 -0400 X-MC-Unique: ycw1WK9nML6u1zJoe_05TA-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a995c3a984dso325167666b.1 for ; Mon, 14 Oct 2024 00:53:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728892421; x=1729497221; 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=XpYBp0Glw6qhc5uIPnL78eLKbUhbnbbx8B94lLKnhns=; b=ML696YAhIo1OzBFVAoPNeUHAZyljr3YgpBzwc8kdgSBIRDjXXF7hVtctDFyeAqqm90 BZEb5f79iudiD3oEGQAp8kubmWLzycQ8jxGl7MB0DsXyUr4RXeQBBa70c9JmXj+pGOuA QMwO+eVz2ZMEaZYsDLeVhgecakB6BO6KKN+iJI6F6x7EIDe377MFv+e+qgGmAtadxZ8o 5uLEWyLmJcmJVak9SPLpq/l4h8XudHIJr3gtkOGhAEDoQX+ejK3JMu5VAPkuoR/JpytL lzBGJ8CVVqIbAWkETqVP/AHirpBstQYwmacoRyLZtpisw+9ILMyFPWHx68F429vqdEcS 4wPg== X-Forwarded-Encrypted: i=1; AJvYcCX20g/CeX9/tR1DU/EDTMjeI3PtJ+6uCp/1DdF0PgZiWaAKWe7D4uCnU8+AC7mrH9oSvo7fQMc4E8Wd6Qc=@vger.kernel.org X-Gm-Message-State: AOJu0YwMsWo9lClk6OoMH1cROZEj6wxAG58WH+daStgZ/gu+EIwlf9GO z2xsG+rkdhWTXvyTAXHp1XXg77uHpp8qloAWMdbZ+mJeL4/VhgsAKLoYPAj+jBV6QzoGUVIopFB XiN+105Rw8QDIIeCqJDY32GDBARn9h5JoAS6fZJxaYh/zSGnl+iZGFdJNRidYYw== X-Received: by 2002:a17:907:2d89:b0:a9a:f84:fefd with SMTP id a640c23a62f3a-a9a0f84ffdcmr212770066b.36.1728892420881; Mon, 14 Oct 2024 00:53:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFMGKWuGwtwW80fKcIghkLSWdQ8q9LlEyh0IA4xEx8zcoRTf66/z6edKXc8FjbNEyk6SOApg== X-Received: by 2002:a17:907:2d89:b0:a9a:f84:fefd with SMTP id a640c23a62f3a-a9a0f84ffdcmr212766766b.36.1728892420454; Mon, 14 Oct 2024 00:53:40 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 00:53:40 -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, Bartosz Golaszewski Subject: [PATCH v7 4/5] gpio: Replace deprecated PCI functions Date: Mon, 14 Oct 2024 09:53:25 +0200 Message-ID: <20241014075329.10400-5-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()"). 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; =20 - retval =3D 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 =3D pcim_iomap_table(pdev)[1]; + base =3D 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"); =20 irq_base =3D readl(base + 0 * sizeof(u32)); gpio_base =3D readl(base + 1 * sizeof(u32)); =20 /* Release the IO mapping, since we already get the info from BAR1 */ - pcim_iounmap_regions(pdev, BIT(1)); + pcim_iounmap_region(pdev, 1); =20 priv =3D devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; =20 priv->dev =3D dev; - priv->reg_base =3D pcim_iomap_table(pdev)[0]; + priv->reg_base =3D 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"); =20 priv->pin_info.pin_ranges =3D mrfld_gpio_ranges; priv->pin_info.nranges =3D ARRAY_SIZE(mrfld_gpio_ranges); --=20 2.46.2 From nobody Wed Nov 27 02:40:25 2024 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 EF60515687D for ; Mon, 14 Oct 2024 07:53:46 +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=1728892429; cv=none; b=fi4+N2xIuZI/2EGMqEr61b/8X0cVLGJlrkIvAVa9VDKjFUdP0MGPT8hHyG59LnJg7JfTJIg4FtbCsx3fsRb6XJk0bzpZqOyH83Ho6RpUGocTzDRa+iR+NoKE+HHx0hc2fnlcIu7+lJDKOVd8WQi0jztr1f/jBB6kbcOGjcWmVtU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728892429; c=relaxed/simple; bh=nDMOGSQ2XtB3JrRu0EJ9o56SNXK6RwOh++m09iUxd1k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nljPThOozQcwLSiBn5eqCQI7t5sjDl2E5PDzUaa0K/U0/NsZKeqhmDj69+SpvF7faT+bzlmhq+ZZQ11uMaF4UOXoN/qgWEYA5LOiXxOn9JygqV9RILC8i4eFH0wvp8+CnJ47jvCp1pgmwrimll02DArGEqf6d4IA+uhfOUUPWnw= 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=E+0MSFvU; 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="E+0MSFvU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728892426; 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=0OVHqbDsKjJZaqCqMxaVmR0wTbzvoxMvtns9x4ea75c=; b=E+0MSFvUoW0z5PNWvXHkPNR23a5QpwM6ocZm0qD37cHIWEJvmgMqXwNo8sWY4QuC4W29ga m4UJDTKMzmBYBFojEp4jJGpt6lDE+G1NfexoMtixgGUd8YTljnHwM6IK6jmDRY1zx16UiL dqdN6NIJ4Wd6eagkZaeYPoQNpJQNylc= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-561-vYlLRQIaPPmurbbu2lzimQ-1; Mon, 14 Oct 2024 03:53:43 -0400 X-MC-Unique: vYlLRQIaPPmurbbu2lzimQ-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a9a1b872d8bso6384966b.1 for ; Mon, 14 Oct 2024 00:53:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728892422; x=1729497222; 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=0OVHqbDsKjJZaqCqMxaVmR0wTbzvoxMvtns9x4ea75c=; b=lhMHy+9y5RN6xKKhgkEvBKuOhKTmubp0laRu4kuuXRmU35ybCVoKHvWGB+KQPXLC5d Qbid6ahT+hZ/YPLqHu8oN2FBssfGKVlmGQba7B2AhDbMosCxyQ6PG3RJ36hSBSFWpgPR Jy1TKPoEzXNrGQbCOlCRCLzcmp2PO1HtLCVopRNE0rNo1pxJHA4v4mQfcwzQdl0OUK/O ptGAOxxj3vFtgzmy83y8GYnihFFyPEGpadfvtDzce4PZ2b/2+O3RvnR1AGKbCynJA7ow H2Cf5YqBShwyo5z9dDskjcVTUMBaCbMibiNaICceQ6a0vgiX3syyVmGYr2rk8Cz/wc5G 7KKg== X-Forwarded-Encrypted: i=1; AJvYcCWsqVu7bPgb5kqj6p5xkFpdl7WF7lZGb8ELf42QAw0lQkm8DqvkWbkT/GDqbLvA/mKCmLitZS81+j07DSc=@vger.kernel.org X-Gm-Message-State: AOJu0YzYgTiwGn0FSi8gRyxpM+yxPUvgoq9XmK3uAeklNUTukifqKzSu R435i1B7gWyHBgw4/SirtwXohex3tjv3VHtgnlC530YFoGJtWZmO3iX/KVWyFSSXwuKtdVIhIbD wbVEET3bnUKyvPMLvw9JIcalf4IeMQ7di95MqnrCyUQQ0WQjhCoAaobtEoSvG6w== X-Received: by 2002:a17:907:3a96:b0:a9a:183a:b84e with SMTP id a640c23a62f3a-a9a183abb4emr54363466b.40.1728892422224; Mon, 14 Oct 2024 00:53:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8RdNLydaZorD0CCxm2b4SOOSEXdTQ49hlT5/qPmabsGXJC6XJB2cZBBIAjLdsQqSMvFgt4Q== X-Received: by 2002:a17:907:3a96:b0:a9a:183a:b84e with SMTP id a640c23a62f3a-a9a183abb4emr54360066b.40.1728892421849; Mon, 14 Oct 2024 00:53:41 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2024 00:53:41 -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 5/5] ethernet: cavium: Replace deprecated PCI functions Date: Mon, 14 Oct 2024 09:53:26 +0200 Message-ID: <20241014075329.10400-6-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()"). 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; =20 - err =3D pcim_iomap_regions(pdev, 1 << PCI_PTP_BAR_NO, pci_name(pdev)); + clock->reg_base =3D pcim_iomap_region(pdev, PCI_PTP_BAR_NO, pci_name(pdev= )); + err =3D PTR_ERR_OR_ZERO(clock->reg_base); if (err) goto error_free; =20 - clock->reg_base =3D pcim_iomap_table(pdev)[PCI_PTP_BAR_NO]; - spin_lock_init(&clock->spin_lock); =20 cc =3D &clock->cycle_counter; @@ -292,7 +291,7 @@ static int cavium_ptp_probe(struct pci_dev *pdev, clock_cfg =3D readq(clock->reg_base + PTP_CLOCK_CFG); clock_cfg &=3D ~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); =20 error_free: devm_kfree(dev, clock); --=20 2.46.2