From nobody Tue Feb 10 20:48:29 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51DB9C77B73 for ; Sun, 4 Jun 2023 05:45:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230102AbjFDFpN (ORCPT ); Sun, 4 Jun 2023 01:45:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230009AbjFDFpC (ORCPT ); Sun, 4 Jun 2023 01:45:02 -0400 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2316BE0 for ; Sat, 3 Jun 2023 22:45:01 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8F8FE5C0110; Sun, 4 Jun 2023 01:45:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 04 Jun 2023 01:45:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1685857500; x= 1685943900; bh=Sz66tRqOl7u4PP0rtKdaeKmYwO41z2vXEGUTAqF6eOk=; b=o 89WvoV8bluHsnci8TokM/pj5qc/eiLfisRvUK4fZo2RVGYR42fpiC94IYdfd0gU9 W1cG/Pfs1AFMYof5UTMjmfM23YMNEuv6SuHDoaN6n8cY7kJlVzb6AVgjoLuoz7VB lAJNbOpGnJwqTedt4JEJijVZfq+I1j6QCei4Ft1cpYw1qgzmyeg0e0ncLjijkCom Vrl+BXuaPCdD4SdtZWS5xxU4cGYQqnuqCVJyLqXfLDZ2b303lg6ZErlS+04crCvX aRl2yh86C4GiNSxX+pjsBnyM/wYgRhsoJ28oe7qAHGbLylBEk2i1JfzNIJleiFB+ /ol7Ze39MU9wN7HWemtXA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1685857500; x=1685943900; bh=S z66tRqOl7u4PP0rtKdaeKmYwO41z2vXEGUTAqF6eOk=; b=LmCckfrTic7A+wlL1 Zlq2lEBWP4sNyoGKP2exgaS0E1/MIxFteoSDU9q6gqZd+KaTGt/8A+XLehuSvVRr DK7epqbP4oBeaIBpatYiNeyZZwfWl84THx5gXv+yHalBsHILmcfkpOFzZaLbj9JC 6Wgb2BI6Atss+5EfAxhbDHbc/n8ALZHzaKuFo22mYYC6vR/3B0DsfErI9wB997Mw Q5/GSrM0NSsx6PcGCFHlvfxZyyiWDNtq6EBsIQz8ib7fgNfE5axxyjTBcaEoFJJU cOMTouNJPnzRerNSMSA0NpHNvQs4tx67S+4Yy9YEjUTN3hzgG+ptUz95sLT8oVkI QhD3w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeeliedguddtudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpeevfefffe ektefgveegfeelheffhfeujedtjeevtefhkeevkedtjeejvddtjefhjeenucevlhhushht vghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 4 Jun 2023 01:44:59 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 3/9] firewire: ohci: use devres for MMIO region mapping Date: Sun, 4 Jun 2023 14:44:45 +0900 Message-Id: <20230604054451.161076-4-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230604054451.161076-1-o-takashi@sakamocchi.jp> References: <20230604054451.161076-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" The PCI framework has the convenient helper function to check and map MMIO region with managed device resource. This commit elaborates 1394 OHCI driver to use the function. Signed-off-by: Takashi Sakamoto --- drivers/firewire/ohci.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index f3d0882a876c..26c64b60144d 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -3608,18 +3608,12 @@ static int pci_probe(struct pci_dev *dev, return -ENXIO; } =20 - err =3D pci_request_region(dev, 0, ohci_driver_name); + err =3D pcim_iomap_regions(dev, 1 << 0, ohci_driver_name); if (err) { - ohci_err(ohci, "MMIO resource unavailable\n"); - return err; - } - - ohci->registers =3D pci_iomap(dev, 0, OHCI1394_REGISTER_SIZE); - if (ohci->registers =3D=3D NULL) { - ohci_err(ohci, "failed to remap registers\n"); - err =3D -ENXIO; - goto fail_iomem; + ohci_err(ohci, "request and map MMIO resource unavailable\n"); + return -ENXIO; } + ohci->registers =3D pcim_iomap_table(dev)[0]; =20 for (i =3D 0; i < ARRAY_SIZE(ohci_quirks); i++) if ((ohci_quirks[i].vendor =3D=3D dev->vendor) && @@ -3644,10 +3638,8 @@ static int pci_probe(struct pci_dev *dev, PAGE_SIZE, &ohci->misc_buffer_bus, GFP_KERNEL); - if (!ohci->misc_buffer) { - err =3D -ENOMEM; - goto fail_iounmap; - } + if (!ohci->misc_buffer) + return -ENOMEM; =20 err =3D ar_context_init(&ohci->ar_request_ctx, ohci, 0, OHCI1394_AsReqRcvContextControlSet); @@ -3747,10 +3739,6 @@ static int pci_probe(struct pci_dev *dev, fail_misc_buf: dma_free_coherent(ohci->card.device, PAGE_SIZE, ohci->misc_buffer, ohci->misc_buffer_bus); - fail_iounmap: - pci_iounmap(dev, ohci->registers); - fail_iomem: - pci_release_region(dev, 0); =20 return err; } @@ -3793,8 +3781,6 @@ static void pci_remove(struct pci_dev *dev) kfree(ohci->it_context_list); kfree(ohci->ir_context_list); pci_disable_msi(dev); - pci_iounmap(dev, ohci->registers); - pci_release_region(dev, 0); =20 dev_notice(&dev->dev, "removing fw-ohci device\n"); } --=20 2.39.2