From 3f9295b65ea44194252d60376036a3618d822152 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sat, 13 Oct 2018 09:26:27 +0200 Subject: scsi: esp_scsi: move dma mapping into the core code Except for the mac_esp driver, which uses PIO or pseudo DMA, all drivers share the same dma mapping calls. Move the dma mapping into the core code using the scsi_dma_map / scsi_dma_unmap helpers, with a special identify mapping variant triggered off a new ESP_FLAG_NO_DMA_MAP flag for mac_esp. Signed-off-by: Christoph Hellwig Tested-by: Finn Thain Signed-off-by: Martin K. Petersen --- drivers/scsi/am53c974.c | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'drivers/scsi/am53c974.c') diff --git a/drivers/scsi/am53c974.c b/drivers/scsi/am53c974.c index 75ac065ef49e..27c0a4a937d9 100644 --- a/drivers/scsi/am53c974.c +++ b/drivers/scsi/am53c974.c @@ -114,30 +114,6 @@ static void pci_esp_write32(struct esp *esp, u32 val, unsigned long reg) return iowrite32(val, esp->regs + (reg * 4UL)); } -static dma_addr_t pci_esp_map_single(struct esp *esp, void *buf, - size_t sz, int dir) -{ - return dma_map_single(esp->dev, buf, sz, dir); -} - -static int pci_esp_map_sg(struct esp *esp, struct scatterlist *sg, - int num_sg, int dir) -{ - return dma_map_sg(esp->dev, sg, num_sg, dir); -} - -static void pci_esp_unmap_single(struct esp *esp, dma_addr_t addr, - size_t sz, int dir) -{ - dma_unmap_single(esp->dev, addr, sz, dir); -} - -static void pci_esp_unmap_sg(struct esp *esp, struct scatterlist *sg, - int num_sg, int dir) -{ - dma_unmap_sg(esp->dev, sg, num_sg, dir); -} - static int pci_esp_irq_pending(struct esp *esp) { struct pci_esp_priv *pep = pci_esp_get_priv(esp); @@ -293,10 +269,6 @@ static u32 pci_esp_dma_length_limit(struct esp *esp, u32 dma_addr, u32 dma_len) static const struct esp_driver_ops pci_esp_ops = { .esp_write8 = pci_esp_write8, .esp_read8 = pci_esp_read8, - .map_single = pci_esp_map_single, - .map_sg = pci_esp_map_sg, - .unmap_single = pci_esp_unmap_single, - .unmap_sg = pci_esp_unmap_sg, .irq_pending = pci_esp_irq_pending, .reset_dma = pci_esp_reset_dma, .dma_drain = pci_esp_dma_drain, -- cgit v1.2.3