Commit 31f4306c authored by Ira Snyder's avatar Ira Snyder Committed by Dan Williams

fsldma: minor codingstyle and consistency fixes

This fixes some minor violations of the coding style. It also changes
the style of the device_prep_dma_*() function definitions so they are
identical.
Signed-off-by: default avatarIra W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 0ab09c36
...@@ -89,7 +89,7 @@ static void set_desc_cnt(struct fsldma_chan *chan, ...@@ -89,7 +89,7 @@ static void set_desc_cnt(struct fsldma_chan *chan,
} }
static void set_desc_src(struct fsldma_chan *chan, static void set_desc_src(struct fsldma_chan *chan,
struct fsl_dma_ld_hw *hw, dma_addr_t src) struct fsl_dma_ld_hw *hw, dma_addr_t src)
{ {
u64 snoop_bits; u64 snoop_bits;
...@@ -99,7 +99,7 @@ static void set_desc_src(struct fsldma_chan *chan, ...@@ -99,7 +99,7 @@ static void set_desc_src(struct fsldma_chan *chan,
} }
static void set_desc_dst(struct fsldma_chan *chan, static void set_desc_dst(struct fsldma_chan *chan,
struct fsl_dma_ld_hw *hw, dma_addr_t dst) struct fsl_dma_ld_hw *hw, dma_addr_t dst)
{ {
u64 snoop_bits; u64 snoop_bits;
...@@ -109,7 +109,7 @@ static void set_desc_dst(struct fsldma_chan *chan, ...@@ -109,7 +109,7 @@ static void set_desc_dst(struct fsldma_chan *chan,
} }
static void set_desc_next(struct fsldma_chan *chan, static void set_desc_next(struct fsldma_chan *chan,
struct fsl_dma_ld_hw *hw, dma_addr_t next) struct fsl_dma_ld_hw *hw, dma_addr_t next)
{ {
u64 snoop_bits; u64 snoop_bits;
...@@ -118,8 +118,7 @@ static void set_desc_next(struct fsldma_chan *chan, ...@@ -118,8 +118,7 @@ static void set_desc_next(struct fsldma_chan *chan,
hw->next_ln_addr = CPU_TO_DMA(chan, snoop_bits | next, 64); hw->next_ln_addr = CPU_TO_DMA(chan, snoop_bits | next, 64);
} }
static void set_ld_eol(struct fsldma_chan *chan, static void set_ld_eol(struct fsldma_chan *chan, struct fsl_desc_sw *desc)
struct fsl_desc_sw *desc)
{ {
u64 snoop_bits; u64 snoop_bits;
...@@ -338,8 +337,7 @@ static void fsl_chan_toggle_ext_start(struct fsldma_chan *chan, int enable) ...@@ -338,8 +337,7 @@ static void fsl_chan_toggle_ext_start(struct fsldma_chan *chan, int enable)
chan->feature &= ~FSL_DMA_CHAN_START_EXT; chan->feature &= ~FSL_DMA_CHAN_START_EXT;
} }
static void append_ld_queue(struct fsldma_chan *chan, static void append_ld_queue(struct fsldma_chan *chan, struct fsl_desc_sw *desc)
struct fsl_desc_sw *desc)
{ {
struct fsl_desc_sw *tail = to_fsl_desc(chan->ld_pending.prev); struct fsl_desc_sw *tail = to_fsl_desc(chan->ld_pending.prev);
...@@ -380,8 +378,8 @@ static dma_cookie_t fsl_dma_tx_submit(struct dma_async_tx_descriptor *tx) ...@@ -380,8 +378,8 @@ static dma_cookie_t fsl_dma_tx_submit(struct dma_async_tx_descriptor *tx)
cookie = chan->common.cookie; cookie = chan->common.cookie;
list_for_each_entry(child, &desc->tx_list, node) { list_for_each_entry(child, &desc->tx_list, node) {
cookie++; cookie++;
if (cookie < 0) if (cookie < DMA_MIN_COOKIE)
cookie = 1; cookie = DMA_MIN_COOKIE;
child->async_tx.cookie = cookie; child->async_tx.cookie = cookie;
} }
...@@ -402,8 +400,7 @@ static dma_cookie_t fsl_dma_tx_submit(struct dma_async_tx_descriptor *tx) ...@@ -402,8 +400,7 @@ static dma_cookie_t fsl_dma_tx_submit(struct dma_async_tx_descriptor *tx)
* *
* Return - The descriptor allocated. NULL for failed. * Return - The descriptor allocated. NULL for failed.
*/ */
static struct fsl_desc_sw *fsl_dma_alloc_descriptor( static struct fsl_desc_sw *fsl_dma_alloc_descriptor(struct fsldma_chan *chan)
struct fsldma_chan *chan)
{ {
struct fsl_desc_sw *desc; struct fsl_desc_sw *desc;
dma_addr_t pdesc; dma_addr_t pdesc;
...@@ -427,7 +424,6 @@ static struct fsl_desc_sw *fsl_dma_alloc_descriptor( ...@@ -427,7 +424,6 @@ static struct fsl_desc_sw *fsl_dma_alloc_descriptor(
return desc; return desc;
} }
/** /**
* fsl_dma_alloc_chan_resources - Allocate resources for DMA channel. * fsl_dma_alloc_chan_resources - Allocate resources for DMA channel.
* @chan : Freescale DMA channel * @chan : Freescale DMA channel
...@@ -537,14 +533,15 @@ fsl_dma_prep_interrupt(struct dma_chan *dchan, unsigned long flags) ...@@ -537,14 +533,15 @@ fsl_dma_prep_interrupt(struct dma_chan *dchan, unsigned long flags)
/* Insert the link descriptor to the LD ring */ /* Insert the link descriptor to the LD ring */
list_add_tail(&new->node, &new->tx_list); list_add_tail(&new->node, &new->tx_list);
/* Set End-of-link to the last link descriptor of new list*/ /* Set End-of-link to the last link descriptor of new list */
set_ld_eol(chan, new); set_ld_eol(chan, new);
return &new->async_tx; return &new->async_tx;
} }
static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy( static struct dma_async_tx_descriptor *
struct dma_chan *dchan, dma_addr_t dma_dst, dma_addr_t dma_src, fsl_dma_prep_memcpy(struct dma_chan *dchan,
dma_addr_t dma_dst, dma_addr_t dma_src,
size_t len, unsigned long flags) size_t len, unsigned long flags)
{ {
struct fsldma_chan *chan; struct fsldma_chan *chan;
...@@ -594,7 +591,7 @@ static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy( ...@@ -594,7 +591,7 @@ static struct dma_async_tx_descriptor *fsl_dma_prep_memcpy(
new->async_tx.flags = flags; /* client is in control of this ack */ new->async_tx.flags = flags; /* client is in control of this ack */
new->async_tx.cookie = -EBUSY; new->async_tx.cookie = -EBUSY;
/* Set End-of-link to the last link descriptor of new list*/ /* Set End-of-link to the last link descriptor of new list */
set_ld_eol(chan, new); set_ld_eol(chan, new);
return &first->async_tx; return &first->async_tx;
......
...@@ -102,8 +102,8 @@ struct fsl_desc_sw { ...@@ -102,8 +102,8 @@ struct fsl_desc_sw {
} __attribute__((aligned(32))); } __attribute__((aligned(32)));
struct fsldma_chan_regs { struct fsldma_chan_regs {
u32 mr; /* 0x00 - Mode Register */ u32 mr; /* 0x00 - Mode Register */
u32 sr; /* 0x04 - Status Register */ u32 sr; /* 0x04 - Status Register */
u64 cdar; /* 0x08 - Current descriptor address register */ u64 cdar; /* 0x08 - Current descriptor address register */
u64 sar; /* 0x10 - Source Address Register */ u64 sar; /* 0x10 - Source Address Register */
u64 dar; /* 0x18 - Destination Address Register */ u64 dar; /* 0x18 - Destination Address Register */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment