Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332871
b: refs/heads/master
c: 5e97fa9
h: refs/heads/master
i:
  332869: 94fc5ba
  332867: 61afbba
  332863: 4e2994b
v: v3
  • Loading branch information
Marek Vasut authored and Vinod Koul committed Sep 14, 2012
1 parent d010f32 commit 4153d2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8fccc5bfd7f83fd321db42bcad36e2d9fe13d65b
refs/heads/master: 5e97fa91492b4943f25228e08d24abb31e5bce50
14 changes: 8 additions & 6 deletions trunk/drivers/dma/mxs-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ struct mxs_dma_ccw {
u32 pio_words[MXS_PIO_WORDS];
};

#define NUM_CCW (int)(PAGE_SIZE / sizeof(struct mxs_dma_ccw))
#define CCW_BLOCK_SIZE (4 * PAGE_SIZE)
#define NUM_CCW (int)(CCW_BLOCK_SIZE / sizeof(struct mxs_dma_ccw))

struct mxs_dma_chan {
struct mxs_dma_engine *mxs_dma;
Expand Down Expand Up @@ -354,14 +355,15 @@ static int mxs_dma_alloc_chan_resources(struct dma_chan *chan)

mxs_chan->chan_irq = data->chan_irq;

mxs_chan->ccw = dma_alloc_coherent(mxs_dma->dma_device.dev, PAGE_SIZE,
&mxs_chan->ccw_phys, GFP_KERNEL);
mxs_chan->ccw = dma_alloc_coherent(mxs_dma->dma_device.dev,
CCW_BLOCK_SIZE, &mxs_chan->ccw_phys,
GFP_KERNEL);
if (!mxs_chan->ccw) {
ret = -ENOMEM;
goto err_alloc;
}

memset(mxs_chan->ccw, 0, PAGE_SIZE);
memset(mxs_chan->ccw, 0, CCW_BLOCK_SIZE);

if (mxs_chan->chan_irq != NO_IRQ) {
ret = request_irq(mxs_chan->chan_irq, mxs_dma_int_handler,
Expand All @@ -387,7 +389,7 @@ static int mxs_dma_alloc_chan_resources(struct dma_chan *chan)
err_clk:
free_irq(mxs_chan->chan_irq, mxs_dma);
err_irq:
dma_free_coherent(mxs_dma->dma_device.dev, PAGE_SIZE,
dma_free_coherent(mxs_dma->dma_device.dev, CCW_BLOCK_SIZE,
mxs_chan->ccw, mxs_chan->ccw_phys);
err_alloc:
return ret;
Expand All @@ -402,7 +404,7 @@ static void mxs_dma_free_chan_resources(struct dma_chan *chan)

free_irq(mxs_chan->chan_irq, mxs_dma);

dma_free_coherent(mxs_dma->dma_device.dev, PAGE_SIZE,
dma_free_coherent(mxs_dma->dma_device.dev, CCW_BLOCK_SIZE,
mxs_chan->ccw, mxs_chan->ccw_phys);

clk_disable_unprepare(mxs_dma->clk);
Expand Down

0 comments on commit 4153d2a

Please sign in to comment.