stmmac: fix dma api misuse
authorGiuseppe CAVALLARO <peppe.cavallaro@st.com>
Wed, 27 Aug 2014 09:27:00 +0000 (11:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 30 Aug 2014 02:54:36 +0000 (19:54 -0700)
commit362b37be01edc7429e3ebaa89613517d57863f5c
treec29059b8d78ad83cd2decf42daa7be8d3a101497
parent5566401f2f10556776fd199c11d6a02a5e0b7b95
stmmac: fix dma api misuse

Enabling DMA_API_DEBUG, warnings are reported at runtime
because the device driver frees DMA memory with wrong functions
and it does not call dma_mapping_error after mapping dma memory.

The first problem is fixed by of introducing a flag that helps us
keeping track which mapping technique was used, so that we can use
the right API for unmap.
This approach was inspired by the e1000 driver, which uses a similar
technique.

Signed-off-by: Andre Draszik <andre.draszik@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: Denis Kirjanov <kda@linux-powerpc.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/chain_mode.c
drivers/net/ethernet/stmicro/stmmac/common.h
drivers/net/ethernet/stmicro/stmmac/ring_mode.c
drivers/net/ethernet/stmicro/stmmac/stmmac.h
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c