From patchwork Wed Oct 16 09:49:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13838046 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 33E15206067 for ; Wed, 16 Oct 2024 09:49:27 +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=1729072169; cv=none; b=dQp7IJIdjIiRpmFjEqWImgoeS1D9Bdi3MgB5jbmjgGU5Krea82DV1V4e8JmbMH7beihu5LDETwfPy0ZGaC633WI4g9HZNXRnAFr5wB0j6XqgH0VZ+OWd1UGVREX2TEUhNyhm3/sV39T+catQqle4OIcxhMANMY2Fkl5vvQadbFY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729072169; c=relaxed/simple; bh=73TDRRq/zYwVvdvTcMvRKEXzW3B5e+Rcch7EgZqO0Rk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UuMY1KmqMYxQsvHmZFhwMfEWkPLj88+eK+2F2xwnTGGL0KlxzcSfamQ5+OSPKg5f/CYhwc0fmOjRq3vLlBkE2xTv62WPHGzbCsuUPtjpQXRETNHYbHGwysRD6DwZ2/yNl3Ha0ZNqGPkoSEhNRVY/mMiocPbYMINjTgVrHbvqywQ= 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=LK6PM3M4; 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="LK6PM3M4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729072166; 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=99YHQrhHcKN4EzxQy/kG1c7OXMv2lQ3JH0aSkE1MYKM=; b=LK6PM3M4MwBe6G45KCCcqddK5j2gTJrRIj81Ap9pDZBTvFhUxr8kQAq1+TcO/xYFc2tgd9 m3XJ+sovx4HqHtIPNEnPyJld49ZUCNn/0uPCWY9BF/WSzL4U8PV90ZkbKdtNq9T31apYKI Cg4/WcifTEJMQmc4DHFHn6o6Hv3BNKs= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-125-A_JnqDTXOSG-lPFyaWSyqA-1; Wed, 16 Oct 2024 05:49:24 -0400 X-MC-Unique: A_JnqDTXOSG-lPFyaWSyqA-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-43052e05c8fso42997355e9.2 for ; Wed, 16 Oct 2024 02:49:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729072163; x=1729676963; 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=99YHQrhHcKN4EzxQy/kG1c7OXMv2lQ3JH0aSkE1MYKM=; b=h64HI7ZQ7pjWNz4m2qlFiAMWw1gkaYZWWtPZsLPykGRizmV7GGl+gZdlDSNZgSirm+ B+WlMNyt6fOHShH57eGd03XFp99xT3Mftxuid6TLKtzw99zssuwloezGBbVXqsiqPdeZ v+ZXeqeYmT9F5YpJptmK3ljU0vygQ2rIS6p0zQbss3t6/XiwkrFBoWcd4khU1/ZWWHbB wzgXqNF/UfyxX5h8j0Syn5qQDWyikGGiOwd7EV4GX21RBOvF27R5W7Uz7GRESHMwWs1y Szb/9M4ULBfld2bEmLv0r8Z1glVp2UAFpv/i6WgB3QVKHBSf2gWHoEeuLwIG2NkuwQS7 uJhQ== X-Forwarded-Encrypted: i=1; AJvYcCWqOT2mG+DdAlTxCqTg92RczQwuWuV6BHfbWoLhF0F9jZE9zY9mQCdiO4E2jGVMAz7eNjspUJ+tT9A2@vger.kernel.org X-Gm-Message-State: AOJu0YyFEPb1QLOtOB8ZDvMtHqVymLM8PIY/iVJEvtKbBgvXrmdp13zB IlMmBQfnX69ULq0m3KYfwjuytVvbiw8tFrfZyyDvIWtzf27TjYp3SEhcIMh4XCyD4wv3WYUd39T fPOjviFbCwXD47Z6qf5mlV4JJBoxdkIGqLUnpafrjk72Q8UsnXsVXllAjnfY= X-Received: by 2002:a05:600c:1c04:b0:42c:aeaa:6aff with SMTP id 5b1f17b1804b1-4311ded42e9mr155157695e9.10.1729072162882; Wed, 16 Oct 2024 02:49:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE8GDQhvsGyXA0X961v7Lmwi/hfrpQA8HclfLV7tXU7H8VLe8dIqSWkJPDQe2YmlweB9M9Vbw== X-Received: by 2002:a05:600c:1c04:b0:42c:aeaa:6aff with SMTP id 5b1f17b1804b1-4311ded42e9mr155157405e9.10.1729072162522; Wed, 16 Oct 2024 02:49:22 -0700 (PDT) Received: from eisenberg.muc.redhat.com (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4314b32e487sm28190235e9.25.2024.10.16.02.49.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 02:49:21 -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 , Philipp Stanner , Chaitanya Kulkarni , Al Viro , 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 v8 3/6] fpga/dfl-pci.c: Replace deprecated PCI functions Date: Wed, 16 Oct 2024 11:49:06 +0200 Message-ID: <20241016094911.24818-5-pstanner@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241016094911.24818-2-pstanner@redhat.com> References: <20241016094911.24818-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; }