From patchwork Mon Aug 19 16:51:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13768729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1AD6C3DA4A for ; Mon, 19 Aug 2024 17:03:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=VvDTGRlH2pE5xUmthqP2K8NKj/VvlYnHCpyCpsJBmcw=; b=VUnjWi5T5o6AwsC2hsa1FUdr/O pta/F32udtEvoBKM/2jqdSbYq2IA63UBml1Jms1B4anRYhFwWG7CSecYE2QiMvq65KYBuBqsaZnuH UKbluhSavBhylNOf7Mc6cvkJOfCJQ7n36qDwdu5dA4DSSQSXGnJYGdlnYmhZn4pKqNp5gvKOUeFgw zHmuw0KEu7xHPzCHC+MrFpQTGoUnsbZ5334aR9Rd6wHjkZFSCALwdQhIjpCMA/W2MbwRU55c5XM/n Fzr2GHuDj4Wo041DHhAYscVZOi+Il2N+3xlcBkTx9pBLVW+bPo55jBdAtKEb+zg0GaU6YSGLGT1px aJx1xf1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg5mZ-00000002Ipx-0iYM; Mon, 19 Aug 2024 17:03:03 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg5cw-00000002Fi8-1yhK for linux-arm-kernel@bombadil.infradead.org; Mon, 19 Aug 2024 16:53:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:Content-Transfer-Encoding :MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=VvDTGRlH2pE5xUmthqP2K8NKj/VvlYnHCpyCpsJBmcw=; b=g49wxYgfckvhBSVQNaKgyuOlDZ YEE93FfusYCbv0z7p7pPnob4rvEHy4soFsXvWwD37ZHd7Sk1QtfUOxNjzVBNapNOkv/J8r0BrSwQ/ p3iKjRZ2Bs2Z0aZ+3haNlVemFbmOOtSLtvPsbgU9T+3Dp6zx4abHOdqhc+UJbOPV5k79YqVrBdoPR TAopSP3jscf20oeJ1xnyjRo2eYsYPhmwTFNQRCjpay1+h5rxFnGy3SPN/eAjEDUMrXLJKVaLzE2wC CuUV2yJOhtIxPYJvjesypP5swzJOK0F+IRuEFPV9oqEOel1aPIO7MNOQ/SQk+1ZGu0vw0NyCwt+3H SyvTLzfQ==; Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg5ct-00000009AwV-0nwR for linux-arm-kernel@lists.infradead.org; Mon, 19 Aug 2024 16:53:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724086373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VvDTGRlH2pE5xUmthqP2K8NKj/VvlYnHCpyCpsJBmcw=; b=J1eobuwPUzikcqsRGWh/+PwxQkCgUZrDgTvaP6BRqjM5WkqzU5ekDU4mJHOLzLw/Ym+Ex5 F/3a+hOM2KMZxExXz+m970aN8UAzpDIYgYMsnZafTw/FJz8K62bd2B0XLGh7b4dKorSlz4 Z0by7bMljhdote1AGDakSle5hm635F8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724086382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VvDTGRlH2pE5xUmthqP2K8NKj/VvlYnHCpyCpsJBmcw=; b=HSqPI6Wjq3AEMub2C22BjH+ONm90b4PQBFql28RdsYkiCPd+R2wnrwUcfgXAg07hNK8KkE /TiTly0yR82RdE8bV6I+HGCuOYppQi2sniNpUKsxSeF56GU232ZcZ2QWkRO2HTBtBhT2UI Y8D9yL8oO6iJMx+34eL1nUNmzvUCbl0= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-465-T8vtS3QcPlmuotAs50-rFA-1; Mon, 19 Aug 2024 12:52:52 -0400 X-MC-Unique: T8vtS3QcPlmuotAs50-rFA-1 Received: by mail-qt1-f198.google.com with SMTP id d75a77b69052e-44ff65342daso4070161cf.2 for ; Mon, 19 Aug 2024 09:52:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724086371; x=1724691171; 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=VvDTGRlH2pE5xUmthqP2K8NKj/VvlYnHCpyCpsJBmcw=; b=B/Ffn3RyJO3tEItrbrRGADQpSMBMFRrGL8GWFA6VgDG+reukTVhEsd52zxhKhFw1No /Q3XTyjdeC84DRQ4NmLGSUAGbMGTfYU5Iv5Vces7+rqnHox0EgSGHt+UEwgJe62gKWUo e7UQyQAA1hPKzNErcTF4vqpvihg75CGIngQYGDJvA2jsG2eurH345mZXSkYLproLZ6z1 OMCGaHK0s+PkpnhYQ6AR5iPgxxkFPYOLndiSkYwOcuLABhHfETBD+D8Tpsub587QQ+VJ D6MxI5WEzNZ7iICbS4a5rcu9wGM4lh5NqNNJ71lhlTeXbJinZB5PSJTfHteIeHC0BHC6 tkpw== X-Forwarded-Encrypted: i=1; AJvYcCUhYWvmK7fcnpW/y43nhtf2/VGOnjInCTaV8ZEgPuyX4LdPG6JWgVv+WJMxyG3dO6QNiIC7E5BwBcLVVvP1KSOgy8pvakbjeVdihlJUH8P7RRc2oVc= X-Gm-Message-State: AOJu0YwgN4M65No2PQkfpSIhxqGlcLNGRjhnIjJvlkIN6bVRsJld5HrE DOVGUIRnN6OBymMs8k1Wp63G+ZWK5d1QDKBZay7ALsLr/cWKD3z2hJnOa+NNTYWnOrRasqUslLh 45SMJCJOAkZir2QQR4zxMjgB2IvlcCjTyKajk9ZJ/yE5TQevthQtg1bqVFtZpsF/o5zh0Vaf9 X-Received: by 2002:a05:620a:2916:b0:7a1:ec82:5fb8 with SMTP id af79cd13be357-7a50693aa1amr850723285a.3.1724086371324; Mon, 19 Aug 2024 09:52:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZa/FD9N9XMYe6vZgYz+o23a4NN1SRn7d1y7DUQ2BvFX9aygcJIaTQ2PovPIikQclvdS1AXw== X-Received: by 2002:a05:620a:2916:b0:7a1:ec82:5fb8 with SMTP id af79cd13be357-7a50693aa1amr850720485a.3.1724086370809; Mon, 19 Aug 2024 09:52:50 -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 af79cd13be357-7a4ff01e293sm446579885a.26.2024.08.19.09.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Aug 2024 09:52:50 -0700 (PDT) From: Philipp Stanner To: onathan Corbet , 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 , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Bjorn Helgaas , Alvaro Karsz , "Michael S. Tsirkin" , Jason Wang , Xuan Zhuo , =?utf-8?q?Eugenio_P=C3=A9rez?= , Richard Cochran , Mark Brown , David Lechner , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Jonathan Cameron , Philipp Stanner , Hannes Reinecke , Damien Le Moal , Chaitanya Kulkarni , "Martin K. Petersen" Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-fpga@vger.kernel.org, linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, virtualization@lists.linux.dev Subject: [PATCH 4/9] block: mtip32xx: Replace deprecated PCI functions Date: Mon, 19 Aug 2024 18:51:44 +0200 Message-ID: <20240819165148.58201-6-pstanner@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240819165148.58201-2-pstanner@redhat.com> References: <20240819165148.58201-2-pstanner@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240819_175303_696798_351EE4CE X-CRM114-Status: GOOD ( 15.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 call to pcim_iounmap_regions() is not necessary, because it's invoked in the remove() function. Cleanup can, hence, be performed by PCI devres automatically. Replace pcim_iomap_regions() and pcim_iomap_table(). Remove the call to pcim_iounmap_regions(). Signed-off-by: Philipp Stanner --- drivers/block/mtip32xx/mtip32xx.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index c6ef0546ffc9..c7da6090954e 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) { @@ -3726,9 +3728,9 @@ static int mtip_pci_probe(struct pci_dev *pdev, } /* Map BAR5 to memory. */ - rv = pcim_iomap_regions(pdev, 1 << MTIP_ABAR, MTIP_DRV_NAME); + rv = pcim_request_region(pdev, 1, MTIP_DRV_NAME); if (rv < 0) { - dev_err(&pdev->dev, "Unable to map regions\n"); + dev_err(&pdev->dev, "Unable to request regions\n"); goto iomap_err; } @@ -3849,7 +3851,7 @@ 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); + pcim_release_region(pdev, MTIP_ABAR); iomap_err: kfree(dd); @@ -3925,7 +3927,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);