staging: dwc2: disable dma when no dma_mask was setup
authorMatthijs Kooijman <matthijs@stdin.nl>
Fri, 19 Jul 2013 09:34:22 +0000 (11:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Jul 2013 21:59:38 +0000 (14:59 -0700)
commita0112f487180bd243aec86b5a8c4b5e2d45e8404
treea6265483f271bf098ba6b589692bcf80a82c8fdc
parent4d3190e1f84f08692f4b87461108f72e9a0b452c
staging: dwc2: disable dma when no dma_mask was setup

If the platform or bus driver failed to setup a dma_mask, but the
hardware advertises support for DMA, before DMA would be enabled in
dwc2, but disabled in the usb core, making all connectivity break.

With this commit, the dwc2 driver will emit a warning and fall back to
slave mode in this case.

Note that since commit 642f2ec (staging: dwc2: Fix dma-enabled platform
devices using a default dma_mask) the platform bindings make sure a DMA
mask is always present, but having this check here anyway is probably a
good from a defensive programming standpoint (in case of changes to
platform.c or addition of new glue layers).

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
Acked-by: Paul Zimmerman <Paul.Zimmerman@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dwc2/hcd.c