From nobody Wed Jul 1 04:19:36 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 CDD91C433FE for ; Sun, 2 Jan 2022 10:30:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232268AbiABKaA (ORCPT ); Sun, 2 Jan 2022 05:30:00 -0500 Received: from smtp07.smtpout.orange.fr ([80.12.242.129]:54388 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232252AbiABK37 (ORCPT ); Sun, 2 Jan 2022 05:29:59 -0500 Received: from pop-os.home ([86.243.171.122]) by smtp.orange.fr with ESMTPA id 3y7fnH6e4FGqt3y7gntgp4; Sun, 02 Jan 2022 11:29:58 +0100 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sun, 02 Jan 2022 11:29:58 +0100 X-ME-IP: 86.243.171.122 From: Christophe JAILLET To: mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] floppy: Remove usage of the deprecated "pci-dma-compat.h" API Date: Sun, 2 Jan 2022 11:29:54 +0100 Message-Id: <9e24eedeab44cbb840598bb188561a48811de845.1641119338.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.32.0 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" In [1], Christoph Hellwig has proposed to remove the wrappers in include/linux/pci-dma-compat.h. Some reasons why this API should be removed have been given by Julia Lawall in [2]. A coccinelle script has been used to perform the needed transformation Only relevant parts are given below. @@ @@ - PCI_DMA_TODEVICE + DMA_TO_DEVICE @@ @@ - PCI_DMA_FROMDEVICE + DMA_FROM_DEVICE @@ expression e1, e2, e3, e4; @@ - pci_map_single(e1, e2, e3, e4) + dma_map_single(&e1->dev, e2, e3, e4) @@ expression e1, e2, e3, e4; @@ - pci_unmap_single(e1, e2, e3, e4) + dma_unmap_single(&e1->dev, e2, e3, e4) [1]: https://lore.kernel.org/kernel-janitors/20200421081257.GA131897@infrad= ead.org/ [2]: https://lore.kernel.org/kernel-janitors/alpine.DEB.2.22.394.2007120902= 170.2424@hadrien/ Signed-off-by: Christophe JAILLET Reviewed-by: Christoph Hellwig --- arch/powerpc/include/asm/floppy.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/floppy.h b/arch/powerpc/include/asm/f= loppy.h index 7af9a68fd949..f8ce178b43b7 100644 --- a/arch/powerpc/include/asm/floppy.h +++ b/arch/powerpc/include/asm/floppy.h @@ -134,17 +134,19 @@ static int hard_dma_setup(char *addr, unsigned long s= ize, int mode, int io) int dir; =20 doing_vdma =3D 0; - dir =3D (mode =3D=3D DMA_MODE_READ) ? PCI_DMA_FROMDEVICE : PCI_DMA_TODEVI= CE; + dir =3D (mode =3D=3D DMA_MODE_READ) ? DMA_FROM_DEVICE : DMA_TO_DEVICE; =20 if (bus_addr=20 && (addr !=3D prev_addr || size !=3D prev_size || dir !=3D prev_dir))= { /* different from last time -- unmap prev */ - pci_unmap_single(isa_bridge_pcidev, bus_addr, prev_size, prev_dir); + dma_unmap_single(&isa_bridge_pcidev->dev, bus_addr, prev_size, + prev_dir); bus_addr =3D 0; } =20 if (!bus_addr) /* need to map it */ - bus_addr =3D pci_map_single(isa_bridge_pcidev, addr, size, dir); + bus_addr =3D dma_map_single(&isa_bridge_pcidev->dev, addr, size, + dir); =20 /* remember this one as prev */ prev_addr =3D addr; --=20 2.32.0