include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[sfrench/cifs-2.6.git] / arch / arm / mach-rpc / dma.c
index a5987bbed60df7078e5d78ab227bcd451acfe760..85883b2e0e49cdecb8eed50a3042842972de5a81 100644 (file)
@@ -9,7 +9,6 @@
  *
  *  DMA functions specific to RiscPC architecture
  */
-#include <linux/slab.h>
 #include <linux/mman.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <asm/mach/dma.h>
 #include <asm/hardware/iomd.h>
 
+struct iomd_dma {
+       struct dma_struct       dma;
+       unsigned int            state;
+       unsigned long           base;           /* Controller base address */
+       int                     irq;            /* Controller IRQ */
+       struct scatterlist      cur_sg;         /* Current controller buffer */
+       dma_addr_t              dma_addr;
+       unsigned int            dma_len;
+};
+
 #if 0
 typedef enum {
        dma_size_8      = 1,
@@ -49,10 +58,10 @@ static void iomd_get_next_sg(struct scatterlist *sg, struct iomd_dma *idma)
        unsigned long end, offset, flags = 0;
 
        if (idma->dma.sg) {
-               sg->dma_address = idma->dma.sg->dma_address;
+               sg->dma_address = idma->dma_addr;
                offset = sg->dma_address & ~PAGE_MASK;
 
-               end = offset + idma->dma.sg->length;
+               end = offset + idma->dma_len;
 
                if (end > PAGE_SIZE)
                        end = PAGE_SIZE;
@@ -62,12 +71,14 @@ static void iomd_get_next_sg(struct scatterlist *sg, struct iomd_dma *idma)
 
                sg->length = end - TRANSFER_SIZE;
 
-               idma->dma.sg->length -= end - offset;
-               idma->dma.sg->dma_address += end - offset;
+               idma->dma_len -= end - offset;
+               idma->dma_addr += end - offset;
 
-               if (idma->dma.sg->length == 0) {
+               if (idma->dma_len == 0) {
                        if (idma->dma.sgcount > 1) {
                                idma->dma.sg = sg_next(idma->dma.sg);
+                               idma->dma_addr = idma->dma.sg->dma_address;
+                               idma->dma_len = idma->dma.sg->length;
                                idma->dma.sgcount--;
                        } else {
                                idma->dma.sg = NULL;
@@ -242,6 +253,11 @@ static struct fiq_handler fh = {
        .name   = "floppydma"
 };
 
+struct floppy_dma {
+       struct dma_struct       dma;
+       unsigned int            fiq;
+};
+
 static void floppy_enable_dma(unsigned int chan, dma_t *dma)
 {
        struct floppy_dma *fdma = container_of(dma, struct floppy_dma, dma);