Skip to content

Commit e57c2fd

Browse files
tititiou36mpe
authored andcommitted
powerpc/floppy: Remove usage of the deprecated "pci-dma-compat.h" API
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/[email protected]/ [2]: https://lore.kernel.org/kernel-janitors/alpine.DEB.2.22.394.2007120902170.2424@hadrien/ Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/9e24eedeab44cbb840598bb188561a48811de845.1641119338.git.christophe.jaillet@wanadoo.fr
1 parent beeac53 commit e57c2fd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

arch/powerpc/include/asm/floppy.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,19 @@ static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
134134
int dir;
135135

136136
doing_vdma = 0;
137-
dir = (mode == DMA_MODE_READ) ? PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE;
137+
dir = (mode == DMA_MODE_READ) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
138138

139139
if (bus_addr
140140
&& (addr != prev_addr || size != prev_size || dir != prev_dir)) {
141141
/* different from last time -- unmap prev */
142-
pci_unmap_single(isa_bridge_pcidev, bus_addr, prev_size, prev_dir);
142+
dma_unmap_single(&isa_bridge_pcidev->dev, bus_addr, prev_size,
143+
prev_dir);
143144
bus_addr = 0;
144145
}
145146

146147
if (!bus_addr) /* need to map it */
147-
bus_addr = pci_map_single(isa_bridge_pcidev, addr, size, dir);
148+
bus_addr = dma_map_single(&isa_bridge_pcidev->dev, addr, size,
149+
dir);
148150

149151
/* remember this one as prev */
150152
prev_addr = addr;

0 commit comments

Comments
 (0)