diff options
Diffstat (limited to 'drivers')
-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 | ||