summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2014-11-25 16:30:39 +0100
committerStefan Agner <stefan.agner@toradex.com>2014-11-25 16:34:23 +0100
commit4cabd68701e13ef94c7f533e05721ab1553daace (patch)
tree481d48acdbf44bbbf617a1fe71ea0232958683b3 /drivers
parent2adb32952ad79026e5fd6308b03910f6e9135d04 (diff)
colibri_vf/usb: fix multiple USB controller usage
Fix usage of multiple USB controllers by setting returning ENODEV for the respective controllers when trying to initialize them in the non-standard mode (on USBH allows only host mode, on USBC allow only device mode).
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/host/ehci-vf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-vf.c b/drivers/usb/host/ehci-vf.c
index 12b9db3c03..c55e622453 100644
--- a/drivers/usb/host/ehci-vf.c
+++ b/drivers/usb/host/ehci-vf.c
@@ -173,10 +173,10 @@ int ehci_hcd_init(int index, enum usb_init_type init,
if (index >= ARRAY_SIZE(nc_reg_bases))
return -EINVAL;
- if (init == USB_INIT_DEVICE)
- index = 0;
- if (init == USB_INIT_HOST)
- index = 1;
+ if (init == USB_INIT_DEVICE && index == 1)
+ return -ENODEV;
+ if (init == USB_INIT_HOST && index == 0)
+ return -ENODEV;
ehci = (struct usb_ehci *)nc_reg_bases[index];