diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-09-23 22:38:51 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-09-27 13:54:03 +0300 |
commit | 8e5481d98bbf1de0ff06a3e488b668572d578e61 (patch) | |
tree | 37d9d82ee20a28f6d4cc820a4532a1184f61577d /drivers/sbus | |
parent | 36131cdfef5aef7f4a9a36423a7a338bd6f68ad6 (diff) | |
download | linux-8e5481d98bbf1de0ff06a3e488b668572d578e61.tar.xz |
serial: stm32: use mapbase instead of membase for DMA
Building this driver with a 64-bit dma_addr_t type results in
a compiler warning:
drivers/tty/serial/stm32-usart.c: In function 'stm32_of_dma_rx_probe':
drivers/tty/serial/stm32-usart.c:746:20: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
drivers/tty/serial/stm32-usart.c: In function 'stm32_of_dma_tx_probe':
drivers/tty/serial/stm32-usart.c:818:20: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
While the type conversion here is harmless, this hints at a different
problem: we pass an __iomem pointer into a DMA engine, which expects
a phys_addr_t. This happens to work because stm32 has no MMU and
ioremap() is an identity mapping here, but it's still an incorrect
API use. Using dma_addr_t is doubly wrong here, because that would
be the result of dma_map_single() rather than the physical address.
Using the mapbase instead fixes multiple issues:
- the warning is gone
- we don't go through ioremap in error
- the cast is gone, making it use the correct resource_size_t/phys_addr_t
type in the process.
Fixes: 3489187204eb ("serial: stm32: adding dma support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Gerald Baeza <gerald.baeza@st.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/sbus')
0 files changed, 0 insertions, 0 deletions