From patchwork Tue Aug 27 18:56:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13780056 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 293541D4146 for ; Tue, 27 Aug 2024 18:56:30 +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=1724784991; cv=none; b=d/jkdO+IsjxYz6SSv9kyIhO1ycu8FSrqKpzUTXwu8+RhSNrBKj0zotoiq/0VlTLRrSoM2U/jCm7cd5itUFzww5+x1vdGNTQRCLFkUYbJGPnyrGIM09L6WnSr/osxV+yH9F4dzAP8Arjh1q0JPraHrQEDWGLevxuaV/5qKPG7NyY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724784991; c=relaxed/simple; bh=V4KRcC8BfWc5Sti/Fdc73KUa8QY4uocvnp5UyVnLmQQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S+8WXXqRIkYa5+FBs/3CExyMpP/VFq46GHKK2yzhgeWfhgzBdy3CLXRte4OTf+RkwJMqhu2zdaLlOvinu49lE4nePUF+fRprPTn4UtGHc7duofQLQImrZMRH6OWw3ExpKnTQbnw+05Q1nfq//MEieuSK9+BLy40DXHbywGW4o1c= 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=BPIx9Baj; 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="BPIx9Baj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724784989; 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=BPIx9BajA15du9gMR1dHT0PXLXpxXo6XKbSA2db9Ft0cF0d5tbgchXYRyq8+kCGDORDmo9 gxuYTvkLQY8EAXkIGDeszt9V2kTvjChr57b4sHUnWJU1FvySKNAyDiD7dbKzKpdLVMVJuW DOI7lPiwKWbOn5C8LGADf/6wKSnaCEs= 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-517-avPOmnhpPDGsRF_yTu_k2Q-1; Tue, 27 Aug 2024 14:56:25 -0400 X-MC-Unique: avPOmnhpPDGsRF_yTu_k2Q-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a868403dbdeso429032666b.1 for ; Tue, 27 Aug 2024 11:56:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724784984; x=1725389784; 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=Gy1wr1BoadMXP09HF19dy3YRRl9TtRPsrL5b08OLq6RCE1IExlmk+dQ5oQLsicMDKm SyhhUzTGNMcHaUmbicaObnfHRHDy1gRoaF/oB1A7TVLadQLKtTrP+g5/pbgnp0txR0SS I2brqAH4OXt80FZ0L5JF+5N/RQf7GBdY4I0AyVJ4ztyM3OACmg7strO6G3+jzeYe1ICL wWHzBY2tIOQlr0p8urBd2jA1E3w91eMHmRtAOFTBys0DEeTbYsClz4XmxVMN5QmpTv64 y0QqfdJIrb/qlh7n7yiILqCkKBDYrkCL45F02hOxBarx9X3B3iQEqV9bz7/KuHMc5Sjb DWEg== X-Forwarded-Encrypted: i=1; AJvYcCXelGC7WsdGI5UioXk8NJ66B2HjSH0iakTo2keV1i+ryKPfntrNGnQA8rSo2lWotpWitt3uEq0=@vger.kernel.org X-Gm-Message-State: AOJu0YxSCMpjCnN6ayq+73c0+6QCm5dxE9didKt5sDGMCEfuXEwKEZoQ Q+jvvus+3IIB8gwcdIHtgOnuMM3L+QgvdmK76LuyDN0tg8vPbJeSU/YZmHzNgypUxCcvfCCF+f4 B0rHT+u20DSkEET8R2VGitxphVWMtS1ew9lprm2ubGHVZ8b828yNU/Q== X-Received: by 2002:a17:907:7252:b0:a77:cf9d:f495 with SMTP id a640c23a62f3a-a86e3a4ce7fmr296322666b.40.1724784983728; Tue, 27 Aug 2024 11:56:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/x6IpxLJLbWNctYsTotEW22H/JYXErvbzu49sBel1g7SXflnutqyYs4SKAlH6O5BaH+21/w== X-Received: by 2002:a17:907:7252:b0:a77:cf9d:f495 with SMTP id a640c23a62f3a-a86e3a4ce7fmr296318366b.40.1724784983124; Tue, 27 Aug 2024 11:56:23 -0700 (PDT) Received: from eisenberg.fritz.box ([2001:16b8:3dbc:3c00:460c:db7e:8195:ddb5]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a86e549c4e9sm141473066b.47.2024.08.27.11.56.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2024 11:56:22 -0700 (PDT) From: Philipp Stanner To: ens 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 , Alvaro Karsz , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , =?utf-8?q?Eugenio_P=C3=A9rez?= , Richard Cochran , Damien Le Moal , Hannes Reinecke , Keith Busch , 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, virtualization@lists.linux.dev Subject: [PATCH v4 2/7] fpga/dfl-pci.c: Replace deprecated PCI functions Date: Tue, 27 Aug 2024 20:56:07 +0200 Message-ID: <20240827185616.45094-3-pstanner@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240827185616.45094-1-pstanner@redhat.com> References: <20240827185616.45094-1-pstanner@redhat.com> Precedence: bulk X-Mailing-List: netdev@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; }