summaryrefslogtreecommitdiff
path: root/drivers/usb/mtu3/mtu3_plat.c
diff options
context:
space:
mode:
authorChunfeng Yun <chunfeng.yun@mediatek.com>2021-05-28 09:11:00 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-03 14:53:04 +0300
commit51c236d5e1d13de6a71fab1292bb015df4002515 (patch)
tree535d8b7491825f8f609dd4a8780ce5d30c4160c8 /drivers/usb/mtu3/mtu3_plat.c
parentf3ec606efc2015060156729b8533216ae0bacf70 (diff)
downloadlinux-51c236d5e1d13de6a71fab1292bb015df4002515.tar.xz
usb: mtu3: skip getting extcon when use manual drd switch
When use manual drd switch, extcon is not used in fact, so no need get it even it exists, just skip it like using role switch. Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Link: https://lore.kernel.org/r/1622182260-23767-5-git-send-email-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/mtu3/mtu3_plat.c')
-rw-r--r--drivers/usb/mtu3/mtu3_plat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/mtu3/mtu3_plat.c b/drivers/usb/mtu3/mtu3_plat.c
index eaeda391693a..bbfabdc1e79b 100644
--- a/drivers/usb/mtu3/mtu3_plat.c
+++ b/drivers/usb/mtu3/mtu3_plat.c
@@ -299,7 +299,10 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
of_property_read_bool(node, "enable-manual-drd");
otg_sx->role_sw_used = of_property_read_bool(node, "usb-role-switch");
- if (!otg_sx->role_sw_used && of_property_read_bool(node, "extcon")) {
+ if (otg_sx->role_sw_used || otg_sx->manual_drd_enabled)
+ goto out;
+
+ if (of_property_read_bool(node, "extcon")) {
otg_sx->edev = extcon_get_edev_by_phandle(ssusb->dev, 0);
if (IS_ERR(otg_sx->edev)) {
return dev_err_probe(dev, PTR_ERR(otg_sx->edev),