From patchwork Mon Oct 14 07:53:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 836417 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 2243C14D430 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=JlvIHg5LSKPRIzUt2TIfZhtZbSqzt1NvGXu5QPnDvchnDHYitlOQ617Yzjwz/sXxmXH5CfyEfgjyOBV6cOR1ofYsrjjkM/xOjLKc8UDVXgDFaTIcCHfE6+6sdaRYcA1TY2MsINZywZqJ2sOZhQ2WCK2mJkiImK8eraCvqDLYLTo= 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=fXEWkiQg; 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="fXEWkiQg" 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=tTleeIx32xfGthGbrYB2jpEkGH+phvUDXuHiflf4emI=; b=fXEWkiQgPaPdPi+qMZ9ZxpvDubS9wJYtzWggRPVejc7vNAoiZzX1do7vpmpWy8R0KHPyno mHK3760A1he/uaCCe5Yg2Cg0S8BcyKH4JGEC6Atbagr2DPT8llG1wvwLLrwYqL1+fuNQhD PzfTRnLh5JYY0HZ+oS6vmxD7SRKOLzg= 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-491-IZ6bCeJdOPKY3aBfgJcL9w-1; Mon, 14 Oct 2024 03:53:39 -0400 X-MC-Unique: IZ6bCeJdOPKY3aBfgJcL9w-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a99f43c4c7bso124829166b.0 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=rURQMfOl2k9+18j9DvKOJO5QLLnf8fPwuYY8s0A35FhbH5daZ2IwZEL6/uh7Q/Rv57 eDmmL7PcUR62oGOBn7LhjFKo5jkrnfM25xYpi8INpepObbt/70vpuedaGQ64/MOgf9qJ AbqbluTwr+8fdpLwxiWuG/Sns95qSLwPwfnnReLc6T6VyoN0z0VtCMeyCgYU569r2K+3 mv1WJC2aU0OyfYGci6gF6ZfKEFgJsESMuQ4goPqlp4D+zEbxRNPioFns4IHwmCgOV8Cp CC7CWlVNOea9NOQl5Qoec56cV8/HhgNYau2Sow6s2UWnRn4mCBZrP15KmINPT/TgNUIZ 1gGA== X-Forwarded-Encrypted: i=1; AJvYcCUvxLpqCVqm/caSwV3ZvmTVS+vEZURvL/SaZXacoEJCYjF58Dwd42t8M4S5RTTo715H+az/0mMVc/a8@vger.kernel.org X-Gm-Message-State: AOJu0Yyd48PVwnpjw7HqPM7YAbCrtCK7KAL1re0a90g7KP8MItwBPxhN x72RilI5kD3ds+vImaqVRR83lccm1xIqzQKZFvOu1JyXBmphnWXXhcrvHXvA1It64P4fkwFBT55 AtUMNxZ3lAjXZzeqaJQ5F0GpStGas4PSeICDHzXS90bpsDkWyoRT/RZ209Vc= X-Received: by 2002:a17:906:478b:b0:a99:fc9a:5363 with SMTP id a640c23a62f3a-a99fc9a60a2mr368731166b.9.1728892418053; 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-gpio@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; }