diff options
author | Chunfeng Yun <chunfeng.yun@mediatek.com> | 2017-10-13 12:10:45 +0300 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2017-10-19 10:38:12 +0300 |
commit | dd9d2f3aa3f8908fc3133041ccba45792549f25c (patch) | |
tree | 4d37538a7e19f8f7abff64346edce553ea8fe3b4 /drivers/usb/mtu3 | |
parent | 6638ec515f2cce73ba996a725fe351fd643e27c8 (diff) | |
download | linux-dd9d2f3aa3f8908fc3133041ccba45792549f25c.tar.xz |
usb: mtu3: set invalid dr_mode as dual-role mode
Treat dr_mode of USB_DR_MODE_UNKNOWN as USB_DR_MODE_OTG to
enhance functional robustness.
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/mtu3')
-rw-r--r-- | drivers/usb/mtu3/mtu3_plat.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c index 7ca81f4e78a3..9ff33579b42e 100644 --- a/drivers/usb/mtu3/mtu3_plat.c +++ b/drivers/usb/mtu3/mtu3_plat.c @@ -283,10 +283,8 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb) return PTR_ERR(ssusb->ippc_base); ssusb->dr_mode = usb_get_dr_mode(dev); - if (ssusb->dr_mode == USB_DR_MODE_UNKNOWN) { - dev_err(dev, "dr_mode is error\n"); - return -EINVAL; - } + if (ssusb->dr_mode == USB_DR_MODE_UNKNOWN) + ssusb->dr_mode = USB_DR_MODE_OTG; if (ssusb->dr_mode == USB_DR_MODE_PERIPHERAL) return 0; |