ARM: dma-mapping: define dma_(un)?map_single in terms of dma_(un)?map_page

Use dma_map_page()/dma_unmap_page() internals to handle dma_map_single()
and dma_unmap_single().

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: dmabounce: avoid needless valid_dma_direction() check

This check is done at the DMA API level, so there's no point repeating
it here.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: dmabounce: separate out decision to bounce

Move the decision to perform DMA bouncing out of map_single() into its
own stand-alone function.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: dmabounce: move decision for bouncing into __dma_map_page()

Move the decision whether to bounce into __dma_map_page(), before
the check for high pages.  This avoids triggering the high page
check for devices which aren't using dmabounce.  Fix the unmap path
to cope too.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: dmabounce: remove useless pr_err

We already check that dev != NULL, so this won't be reached.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: dmabounce: check pointer against NULL not 0

Pointers should be checked against NULL rather than 0, otherwise we
get sparse warnings.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: dmabounce: correct unmap_single dev_dbg

DMA addresses should not be casted to void * for printing.  Fix
that to be consistent with the rest of the file.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
ARM: dmabounce: get rid of dma_needs_bounce global function

Pass the device type specific needs_bounce function in at dmabounce
register time, avoiding the need for a platform specific global
function to do this.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>