]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/dma/imx-dma.c
pinctrl: pinctrl-mxs: Take care of frees if the kzalloc fails
[mirror_ubuntu-zesty-kernel.git] / drivers / dma / imx-dma.c
index bb787d8e15296ed17eef8032be17f4b52647d173..fcfeb3cd8d3170aff7c30d6d151a0e7e15ecd968 100644 (file)
@@ -227,7 +227,7 @@ static inline int imxdma_sg_next(struct imxdma_desc *d)
        struct scatterlist *sg = d->sg;
        unsigned long now;
 
-       now = min(d->len, sg->length);
+       now = min(d->len, sg_dma_len(sg));
        if (d->len != IMX_DMA_LENGTH_LOOP)
                d->len -= now;
 
@@ -763,16 +763,16 @@ static struct dma_async_tx_descriptor *imxdma_prep_slave_sg(
        desc = list_first_entry(&imxdmac->ld_free, struct imxdma_desc, node);
 
        for_each_sg(sgl, sg, sg_len, i) {
-               dma_length += sg->length;
+               dma_length += sg_dma_len(sg);
        }
 
        switch (imxdmac->word_size) {
        case DMA_SLAVE_BUSWIDTH_4_BYTES:
-               if (sgl->length & 3 || sgl->dma_address & 3)
+               if (sg_dma_len(sgl) & 3 || sgl->dma_address & 3)
                        return NULL;
                break;
        case DMA_SLAVE_BUSWIDTH_2_BYTES:
-               if (sgl->length & 1 || sgl->dma_address & 1)
+               if (sg_dma_len(sgl) & 1 || sgl->dma_address & 1)
                        return NULL;
                break;
        case DMA_SLAVE_BUSWIDTH_1_BYTE:
@@ -831,13 +831,13 @@ static struct dma_async_tx_descriptor *imxdma_prep_dma_cyclic(
                imxdmac->sg_list[i].page_link = 0;
                imxdmac->sg_list[i].offset = 0;
                imxdmac->sg_list[i].dma_address = dma_addr;
-               imxdmac->sg_list[i].length = period_len;
+               sg_dma_len(&imxdmac->sg_list[i]) = period_len;
                dma_addr += period_len;
        }
 
        /* close the loop */
        imxdmac->sg_list[periods].offset = 0;
-       imxdmac->sg_list[periods].length = 0;
+       sg_dma_len(&imxdmac->sg_list[periods]) = 0;
        imxdmac->sg_list[periods].page_link =
                ((unsigned long)imxdmac->sg_list | 0x01) & ~0x02;