]> git.hungrycats.org Git - linux/commitdiff
[ARM] Update DMA usage in Acorn SCSI drivers
authorRussell King <rmk@flint.arm.linux.org.uk>
Sun, 12 Jan 2003 14:44:00 +0000 (14:44 +0000)
committerRussell King <rmk@flint.arm.linux.org.uk>
Sun, 12 Jan 2003 14:44:00 +0000 (14:44 +0000)
Remove the pci_dma functionality from the Acorn SCSI drivers, and
replace with the new DMA API, passing in the generic struct device.

drivers/acorn/scsi/cumana_2.c
drivers/acorn/scsi/eesox.c
drivers/acorn/scsi/powertec.c

index efd1ead5dd17d827d5a2cd4a6a4ccccc12fb2d15..2944d6c79665f5409fac6107abbebf9bc6588092 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/dma.h>
 #include <asm/ecard.h>
@@ -163,26 +164,27 @@ cumanascsi_2_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
                       fasdmadir_t direction, fasdmatype_t min_type)
 {
        struct cumanascsi2_info *info = (struct cumanascsi2_info *)host->hostdata;
+       struct device *dev = scsi_get_device(host);
        int dmach = host->dma_channel;
 
        outb(ALATCH_DIS_DMA, info->alatch);
 
        if (dmach != NO_DMA &&
            (min_type == fasdma_real_all || SCp->this_residual >= 512)) {
-               int bufs, pci_dir, dma_dir, alatch_dir;
+               int bufs, map_dir, dma_dir, alatch_dir;
 
                bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG);
 
                if (direction == DMA_OUT)
-                       pci_dir = PCI_DMA_TODEVICE,
+                       map_dir = DMA_TO_DEVICE,
                        dma_dir = DMA_MODE_WRITE,
                        alatch_dir = ALATCH_DMA_OUT;
                else
-                       pci_dir = PCI_DMA_FROMDEVICE,
+                       map_dir = DMA_FROM_DEVICE,
                        dma_dir = DMA_MODE_READ,
                        alatch_dir = ALATCH_DMA_IN;
 
-               pci_map_sg(NULL, info->sg, bufs + 1, pci_dir);
+               dma_map_sg(dev, info->sg, bufs + 1, map_dir);
 
                disable_dma(dmach);
                set_dma_sg(dmach, info->sg, bufs + 1);
index 0d31f5740ffae5e477d5e7183ee6c43b004e28f3..aa4fba599a9451a909e08cdee85fcac046543aad 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -165,22 +166,23 @@ eesoxscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
                       fasdmadir_t direction, fasdmatype_t min_type)
 {
        struct eesoxscsi_info *info = (struct eesoxscsi_info *)host->hostdata;
+       struct device *dev = scsi_get_device(host);
        int dmach = host->dma_channel;
 
        if (dmach != NO_DMA &&
            (min_type == fasdma_real_all || SCp->this_residual >= 512)) {
-               int bufs, pci_dir, dma_dir;
+               int bufs, map_dir, dma_dir;
 
                bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG);
 
                if (direction == DMA_OUT)
-                       pci_dir = PCI_DMA_TODEVICE,
+                       map_dir = DMA_TO_DEVICE,
                        dma_dir = DMA_MODE_WRITE;
                else
-                       pci_dir = PCI_DMA_FROMDEVICE,
+                       map_dir = DMA_FROM_DEVICE,
                        dma_dir = DMA_MODE_READ;
 
-               pci_map_sg(NULL, info->sg, bufs + 1, pci_dir);
+               dma_map_sg(dev, info->sg, bufs + 1, map_dir);
 
                disable_dma(dmach);
                set_dma_sg(dmach, info->sg, bufs + 1);
index 877c3c8e05042c02d67a73a7d0362ef2e391e50b..4bf7e63dc35e9adb68c5cd0dc715b6dc51ea4502 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/init.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/dma.h>
 #include <asm/ecard.h>
@@ -135,22 +136,23 @@ powertecscsi_dma_setup(struct Scsi_Host *host, Scsi_Pointer *SCp,
                       fasdmadir_t direction, fasdmatype_t min_type)
 {
        struct powertec_info *info = (struct powertec_info *)host->hostdata;
+       struct device *dev = scsi_get_device(host);
        int dmach = host->dma_channel;
 
        if (dmach != NO_DMA &&
            (min_type == fasdma_real_all || SCp->this_residual >= 512)) {
-               int bufs, pci_dir, dma_dir;
+               int bufs, map_dir, dma_dir;
 
                bufs = copy_SCp_to_sg(&info->sg[0], SCp, NR_SG);
 
                if (direction == DMA_OUT)
-                       pci_dir = PCI_DMA_TODEVICE,
+                       map_dir = DMA_TO_DEVICE,
                        dma_dir = DMA_MODE_WRITE;
                else
-                       pci_dir = PCI_DMA_FROMDEVICE,
+                       map_dir = DMA_FROM_DEVICE,
                        dma_dir = DMA_MODE_READ;
 
-               pci_map_sg(NULL, info->sg, bufs + 1, pci_dir);
+               dma_map_sg(dev, info->sg, bufs + 1, map_dir);
 
                disable_dma(dmach);
                set_dma_sg(dmach, info->sg, bufs + 1);