diff options
author | Maxime Ripard <maxime.ripard@free-electrons.com> | 2014-07-30 04:30:21 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2014-07-30 09:44:17 -0400 |
commit | 92e4a3bf3812b0b0d06c6736fe4d83e1442640ef (patch) | |
tree | 3d91eb776b1321734283149faf2ae17de7fa787e /drivers/dma | |
parent | 2795eedf2fbd816f1bba0e8eb5f33434a67d61c2 (diff) |
dmaengine: sun6i: Remove switch statement from buswidth convertion routine
Since the conversion routine is quite trivial, we don't need this switch, and
we can just use a simple calculation.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/sun6i-dma.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c index c771d90b8ded..609c5d8cb947 100644 --- a/drivers/dma/sun6i-dma.c +++ b/drivers/dma/sun6i-dma.c | |||
@@ -248,20 +248,11 @@ static inline int convert_burst(u32 maxburst, u8 *burst) | |||
248 | 248 | ||
249 | static inline int convert_buswidth(enum dma_slave_buswidth addr_width, u8 *width) | 249 | static inline int convert_buswidth(enum dma_slave_buswidth addr_width, u8 *width) |
250 | { | 250 | { |
251 | switch (addr_width) { | 251 | if ((addr_width < DMA_SLAVE_BUSWIDTH_1_BYTE) || |
252 | case DMA_SLAVE_BUSWIDTH_1_BYTE: | 252 | (addr_width > DMA_SLAVE_BUSWIDTH_4_BYTES)) |
253 | *width = 0; | ||
254 | break; | ||
255 | case DMA_SLAVE_BUSWIDTH_2_BYTES: | ||
256 | *width = 1; | ||
257 | break; | ||
258 | case DMA_SLAVE_BUSWIDTH_4_BYTES: | ||
259 | *width = 2; | ||
260 | break; | ||
261 | default: | ||
262 | return -EINVAL; | 253 | return -EINVAL; |
263 | } | ||
264 | 254 | ||
255 | *width = addr_width >> 1; | ||
265 | return 0; | 256 | return 0; |
266 | } | 257 | } |
267 | 258 | ||