From patchwork Wed Aug 21 07:18:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philipp Stanner X-Patchwork-Id: 13770944 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 3DF12C52D6F for ; Wed, 21 Aug 2024 07:22:09 +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=CLI8bZjR6OdWE6SPmBhjzuWJVjW15O9K3MBwEhWkwDY=; b=NqZ4KU2fJxEpjNWTLtFfzfWD2Q /XhIbp11U4rWbDtg1ko4yqP2Npww5uQ0B/88hzvffgF7o8wtrLYGytpOx+W1UTQhQ2trQXWZtkxFD dYHN4ALKufzP7/qhVdtXsWfD+f1LYb80ZMW53MwQY3o1V0v7Jv9g1lIADGIlgHnFrc0QXKsOLBR5I GTSmnl59zUOSxmUuMJdHzw0Wm8EjZE1tFiVaYepAbsXWH7d0kBfFO/B4kiyqu7WOyM+hKWcLVHlM7 IIycm9m+eXO5oTC8Tkt6VFxex7xqynKMRK9hjd9xeqREQ84rJgVy3I7bliz22dosLaxWKQq3LBeXA m/qHkytA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgffJ-00000007sie-0OT8; Wed, 21 Aug 2024 07:21:57 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgfck-00000007rhI-250b for linux-arm-kernel@lists.infradead.org; Wed, 21 Aug 2024 07:19:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724224757; 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=CLI8bZjR6OdWE6SPmBhjzuWJVjW15O9K3MBwEhWkwDY=; b=SBI4eUq+kkz97PsPcZrDxcCfP2DvoajxiroxRMLzem7onMZODHVsPsOM3fIaClLo+XTOCY 1TxVNJUKHxTGCLJPB7KwOy9MNTVbWhDxBy0ixYedr9jlgpEKRn++OcCDe7J4okkn7ZS61X Sid52sl/7/IDr9Q/Q39R2aMBFDJJQPU= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-664-BMHcY8ocP_au6iEeJ0FnJQ-1; Wed, 21 Aug 2024 03:19:16 -0400 X-MC-Unique: BMHcY8ocP_au6iEeJ0FnJQ-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7a1ddb0cf87so666379085a.0 for ; Wed, 21 Aug 2024 00:19:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724224755; x=1724829555; 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=CLI8bZjR6OdWE6SPmBhjzuWJVjW15O9K3MBwEhWkwDY=; b=gtSLU+ebjw/ZxSlXRYSxFbJ6Id3clgPB2zdiSRztN16/UOJBz5GzGLLWPaQ83zzTn4 krax7UgbXcao82y30kCrEMAnwvzHbqPXG8mMn9PYfJM7JpDRNXwuB1ZVl7X7gUbwhA4m s/lDm320mUoz1E8lAAkCpy4nA08sHZfdHI2FdPKNrJHBCS3CcF9kZS0aE3ZMe/vY/QC1 u5alEQvrSCaefJtV+WWczAVnc2op86DH30tczjZTbwXmj68H4gWwg7jkcVH4L6ungCuM HTfNhIFlbS6JOckueVzdEyt1s9jZ+iWTdF9T1k1yUTcwwD6LUhfFjgcYmEU8Fac8VxTD gS7A== X-Forwarded-Encrypted: i=1; AJvYcCVIUPEYkoqA2RXxNGGbGpAroXNWrRdEJG2ODBdf7N6spTuVRkZ5HuXsZ7SkC3ThPiSJDsMGAqsrrbK+VP7Ey/BR@lists.infradead.org X-Gm-Message-State: AOJu0Yxm1ND7U27giBIoDybdaeG/kvgpYltlBatdT+OyQ8Y42cQJT3R9 OBjNzHfI8Mqo+YlRKCvvlnmGsKoG85EzVt3XRG4BtT9ETwQ/enO6MHROwfGttE9/21+gRAVPMNi aOi8czmZdvfanj4zxemdCUMy+iKutq9347wW5Y+KYgQSBkgLx5xiGlqbPL3+uJM+Q/IXNsZqu X-Received: by 2002:a05:620a:1906:b0:79e:f8b7:5c73 with SMTP id af79cd13be357-7a6740c5e31mr226526685a.55.1724224755553; Wed, 21 Aug 2024 00:19:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtpkoHy3cS2PdzwF01k905nXUdsELS2xvQjiGeTjNuWZ60d5TFnGqma74hup77Ia1MJryw5Q== X-Received: by 2002:a05:620a:1906:b0:79e:f8b7:5c73 with SMTP id af79cd13be357-7a6740c5e31mr226522685a.55.1724224755041; Wed, 21 Aug 2024 00:19:15 -0700 (PDT) Received: from eisenberg.redhat.com (nat-pool-muc-t.redhat.com. [149.14.88.26]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7a4ff013ef2sm596207885a.11.2024.08.21.00.19.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Aug 2024 00:19:14 -0700 (PDT) From: Philipp Stanner To: Jonathan 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?= , Philipp Stanner , Damien Le Moal , Hannes Reinecke , Keith Busch 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 v2 3/9] block: mtip32xx: Replace deprecated PCI functions Date: Wed, 21 Aug 2024 09:18:36 +0200 Message-ID: <20240821071842.8591-5-pstanner@redhat.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240821071842.8591-2-pstanner@redhat.com> References: <20240821071842.8591-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-20240821_001918_628078_3D4DD997 X-CRM114-Status: GOOD ( 15.45 ) 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 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 --- drivers/block/mtip32xx/mtip32xx.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index c6ef0546ffc9..fcd5806621c7 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, MTIP_ABAR, 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,8 +3851,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); @@ -3925,7 +3925,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);