In some case, dev->dma_mask isn't set by ehci platform driver. This can
cause nasty bugs difficult to debug (for example setup_dma mapped at 0).
Check it at init time.
Signed-off-by: Matthieu CASTET <matthieu.castet@xxxxxxxxxx>
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index a3ef2a9..8b8067a 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -522,6 +522,8 @@ static int ehci_init(struct usb_hcd *hcd)
u32 hcc_params;
struct ehci_qh_hw *hw;
+ /* we need dma buffer */
+ BUG_ON(hcd->self.uses_dma == 0 && (hcd->driver->flags & HCD_LOCAL_MEM) == 0);
spin_lock_init(&ehci->lock);
/*