Skip to content

Commit 51c236d

Browse files
Chunfeng Yungregkh
authored andcommitted
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>
1 parent f3ec606 commit 51c236d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/usb/mtu3/mtu3_plat.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,10 @@ static int get_ssusb_rscs(struct platform_device *pdev, struct ssusb_mtk *ssusb)
299299
of_property_read_bool(node, "enable-manual-drd");
300300
otg_sx->role_sw_used = of_property_read_bool(node, "usb-role-switch");
301301

302-
if (!otg_sx->role_sw_used && of_property_read_bool(node, "extcon")) {
302+
if (otg_sx->role_sw_used || otg_sx->manual_drd_enabled)
303+
goto out;
304+
305+
if (of_property_read_bool(node, "extcon")) {
303306
otg_sx->edev = extcon_get_edev_by_phandle(ssusb->dev, 0);
304307
if (IS_ERR(otg_sx->edev)) {
305308
return dev_err_probe(dev, PTR_ERR(otg_sx->edev),

0 commit comments

Comments
 (0)